home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-19
/
elflib.zip
/
ELF.DOC
< prev
next >
Wrap
Text File
|
1992-12-01
|
180KB
|
4,048 lines
ELF
EXTENDED LISP FUNCTION LIBRARY
for AutoLISP
Version 1.0 Documentation
and Reference Manual
December 1, 1992
_______
____|__ | (R)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
Mountain Software
Autodesk Registered Developer
1579 Nottingham Road
Charleston, WV 25314
CIS 70717,3564
Orders: 1-800-2424-PsL
Copyright 1992 Jerome Lee Workman, jr.
all rights reserved
EXTENDED LISP FUNCTION LIBRARY
Table of Contents
Using ELF
Introduction . . . . . . . . . . . . . . . . . . . . . . . 1
ELF Features . . . . . . . . . . . . . . . . . . . . . . . 1
Installation . . . . . . . . . . . . . . . . . . . . . . . 3
ACAD.ADS . . . . . . . . . . . . . . . . . . . . . . . . . 3
ACAD.LSP . . . . . . . . . . . . . . . . . . . . . . . . . 4
Sample Programs . . . . . . . . . . . . . . . . . . . . . . 4
ELFDOS Commands
cd . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
change directories; chdir, dcd
cls . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
clear (erase) the text screen;
c: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
logs to C: drive;
dcopy . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
copy DOS file(s);
derase . . . . . . . . . . . . . . . . . . . . . . . . . . 6
erase / delete DOS file(s); ddel
dir . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
prints a file directory list; ddir
drename . . . . . . . . . . . . . . . . . . . . . . . . . . 6
rename / move file(s); dmove
elf . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
displays a list of all ELF commands and functions;
ff . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
find file(s) on the AutoCAD library path and DOS path;
look . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
display ASCII file(s) to the screen using the ELF browser;
mkdir . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
create a directory; md, dmd
password . . . . . . . . . . . . . . . . . . . . . . . . . 8
register ELF with your password (obtain from Mountain
Software);
rmdir . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
remove (delete) a directory; rd, drd
sd . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
set default disk drive; dsd
symbol . . . . . . . . . . . . . . . . . . . . . . . . . . 9
displays the value of an AutoLISP symbol;
ver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
prints ELF, DOS and AutoCAD version numbers;
AutoLISP Functions
Optional Parameters . . . . . . . . . . . . . . . . . . . . 10
Variable Parameters . . . . . . . . . . . . . . . . . . . . 10
Data Types . . . . . . . . . . . . . . . . . . . . . . . . 10
Return Values . . . . . . . . . . . . . . . . . . . . . . . 11
ELF Documentation Table of Contents, Page ii
Video Functions
box . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
draws a box (rectangle) on the text screen using graphic
ascii characters.; (box col row ecol erow attr btype)
cls . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
clear text screen to optional color attribute; (cls attr)
get_video . . . . . . . . . . . . . . . . . . . . . . . . . 12
get current text screen video parameters; (get_video)
printf . . . . . . . . . . . . . . . . . . . . . . . . . . 13
formatted "C" type print to text screen or graphics
command prompt area; (printf format ...)
prts . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
fast write to text screen at col, row position with
optional attribute; (prts col row string attr)
puts . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
fast write to text screen at cursor position with optional
attribute; (puts string attr)
restore_screen . . . . . . . . . . . . . . . . . . . . . . 14
restores a previously captured text screen;
(restore_screen)
save_screen . . . . . . . . . . . . . . . . . . . . . . . . 14
captures the contents of the text screen to a memory
buffer; (save_screen)
scr_fill . . . . . . . . . . . . . . . . . . . . . . . . . 14
fill a rectangle of the text screen with a character and
color attribute; (scr_fill col row cols rows ch attr)
scr_printf . . . . . . . . . . . . . . . . . . . . . . . . 15
formatted "C" type print to text screen using direct video
buffer write; (scr_printf format ...)
set_color . . . . . . . . . . . . . . . . . . . . . . . . . 15
sets the internal "color" variable for use by subsequent
uses of routines which can use the default color (r11);
(set_color attr)
Cursor Functions
get_cursor . . . . . . . . . . . . . . . . . . . . . . . . 16
get cursor size / shape; (get_cursor)
getxy . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
get cursor screen coordinates; (getxy)
gotoxy . . . . . . . . . . . . . . . . . . . . . . . . . . 16
position the screen cursor; (gotoxy col row)
set_cursor . . . . . . . . . . . . . . . . . . . . . . . . 16
set cursor size; start to end scan lines; (set_cursor
start end)
Window Functions
set_menu_help . . . . . . . . . . . . . . . . . . . . . . . 17
sets the user help string list for wmenu; (set_menu_help
<slist>)
wclose . . . . . . . . . . . . . . . . . . . . . . . . . . 18
closes the top window restoring the screen under the
window; (wclose)
wcloseall . . . . . . . . . . . . . . . . . . . . . . . . . 18
closes all windows; (wcloseall)
ELF Documentation Table of Contents, Page iii
wclreol . . . . . . . . . . . . . . . . . . . . . . . . . . 18
erase from window cursor to end of line; (wclreol)
wcls . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
clear window to optional color attribute; (wcls attr)
werase_line . . . . . . . . . . . . . . . . . . . . . . . . 19
erase a line of text from a window; (werase_line line)
wgetstr . . . . . . . . . . . . . . . . . . . . . . . . . . 19
open a window centered on the text screen, prints a prompt
on the top border and gets string input.; (wgetstr prompt
default length wattr battr btype)
wgetdrive . . . . . . . . . . . . . . . . . . . . . . . . . 19
select a disk drive from a menu, all valid drives are
listed with their respective drive type (eg
removable/floppy, fixed, network, and redirected devices);
(wgetdrive col row wattr battr hattr btype)
wgetfile . . . . . . . . . . . . . . . . . . . . . . . . . 20
select a file from a menu of DOS files from the current
directory. The user can change directories and access all
available disk drives.; (wgetfile filespec fileattr col
row wattr battr hattr btype)
wgetxy . . . . . . . . . . . . . . . . . . . . . . . . . . 21
get window screen position; (wgetxy)
wgotoxy . . . . . . . . . . . . . . . . . . . . . . . . . . 21
move window cursor; (wgotoxy col row)
winfo . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
gets the top window size and position; (winfo)
wmenu . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
opens a centered window and displays a menu. The user can
then select one of the displayed items.; (wmenu slist
wattr battr hattr btype shadow title)
wmsg . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
opens a centered window, displays a message and optionally
waits for a keystroke and closes the window; (wmsg str
wait attr battr btype)
wopen . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
open a window on the text screen with specified location,
size, border, and colors; saving the area under the
window; (wopen col row cols rows wattr battr btype)
wpopup . . . . . . . . . . . . . . . . . . . . . . . . . . 24
open a window centered on the text screen; (wpopup cols
rows wattr battr)
wprintf . . . . . . . . . . . . . . . . . . . . . . . . . . 25
printf to window at window cursor position; (wprintf
format ...)
wprts . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
write to window at col, row position with optional
attribute; (wprts col row string attr)
wputcen . . . . . . . . . . . . . . . . . . . . . . . . . . 25
write a centered string to window at window cursor row
position; (wputcen str)
wputs . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
write to window at window cursor position with optional
attribute; (puts string attr)
wscroll . . . . . . . . . . . . . . . . . . . . . . . . . . 26
ELF Documentation Table of Contents, Page iv
scroll window text; (wscroll dir start end lines)
wshadow . . . . . . . . . . . . . . . . . . . . . . . . . . 26
adds a drop shadow to the top (last opened) window;
(wshadow attr)
wtitle . . . . . . . . . . . . . . . . . . . . . . . . . . 27
prints on the border of a window in one of 6 positions;
(wtitle <str> [<pos>])
Keyboard Functions
getch . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
get a character from the keyboard; (getch)
getche . . . . . . . . . . . . . . . . . . . . . . . . . . 28
get a character from the keyboard with echo; (getche)
getkey . . . . . . . . . . . . . . . . . . . . . . . . . . 28
get a keystroke from the keyboard; (getkey)
kbhit . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
checks the keyboard buffer for a waiting keystroke;
(kbhit)
key_clear . . . . . . . . . . . . . . . . . . . . . . . . . 29
clears the keyboard buffer of any pending keystrokes;
(key_clear)
key_ready . . . . . . . . . . . . . . . . . . . . . . . . . 29
returns immediately with a waiting key; (key_ready)
key_stat . . . . . . . . . . . . . . . . . . . . . . . . . 29
gets the state of keyboard shift and other special keys;
(key_stat)
key_stuff . . . . . . . . . . . . . . . . . . . . . . . . . 29
"pushes" keys into the keyboard buffer; (key_stuff str)
Directory Functions
access . . . . . . . . . . . . . . . . . . . . . . . . . . 30
determines if a file exists and can be accessed by mode;
(access path mode)
chdir . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
change disk directory; (chdir path)
chpath . . . . . . . . . . . . . . . . . . . . . . . . . . 31
change current disk drive and directory; (chpath path)
disk_ready . . . . . . . . . . . . . . . . . . . . . . . . 31
verifies that a removable (floppy) drive is ready and
readable; (disk_ready drive)
disk_type . . . . . . . . . . . . . . . . . . . . . . . . . 31
; (disk_type drive)
disk_valid . . . . . . . . . . . . . . . . . . . . . . . . 31
verifies that a disk drive is a valid device (but not
necessarily ready if a removable/floppy drive);
(disk_valid drive)
erasefile . . . . . . . . . . . . . . . . . . . . . . . . . 32
erase file(s); (erasefile filename)
file_exists . . . . . . . . . . . . . . . . . . . . . . . . 32
determines if a file exists; (file_exists path)
findfirst . . . . . . . . . . . . . . . . . . . . . . . . . 32
finds the first instance of a file who's name and
directory attributes match the arguments.; (findfirst
filespec attribute)
ELF Documentation Table of Contents, Page v
findnext . . . . . . . . . . . . . . . . . . . . . . . . . 33
finds the next occurrence of the file specification and
attribute after a findfirst call; (findnext)
fullpath . . . . . . . . . . . . . . . . . . . . . . . . . 34
expands a partial path into a full DOS path string;
(fullpath path)
getdir . . . . . . . . . . . . . . . . . . . . . . . . . . 34
returns a string with the current drive:\path; (getdir)
getdiskfree . . . . . . . . . . . . . . . . . . . . . . . . 34
returns size statistics in the specified drive number as a
list; (getdiskfree 3)
getdisk . . . . . . . . . . . . . . . . . . . . . . . . . . 35
returns the current drive number (A=1, B=2, C=3, etc);
(getdisk)
load_dirs . . . . . . . . . . . . . . . . . . . . . . . . . 35
returns a list of strings containing file directories from
the current directory; (load_dirs)
load_drives . . . . . . . . . . . . . . . . . . . . . . . . 35
returns a list of strings containing all valid disk
drives; (load_drives)
load_files . . . . . . . . . . . . . . . . . . . . . . . . 35
returns a list of strings containing files matching a
filespec and directory attribute; (load_files filespec
attribute)
makepath . . . . . . . . . . . . . . . . . . . . . . . . . 36
Combines the four components into a full DOS path string;
(makepath drive dir name ext)
mkdir . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
creates a new directory; (mkdir dirname)
rmdir . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
removes (deletes) a directory; (rmdir dirname)
setdisk . . . . . . . . . . . . . . . . . . . . . . . . . . 36
logs to the specified disk drive; (setdisk drive)
splitpath . . . . . . . . . . . . . . . . . . . . . . . . . 37
splits a DOS path string into its four components;
(splitpath path)
unlink . . . . . . . . . . . . . . . . . . . . . . . . . . 37
erase file(s); (unlink filename)
File Functions
copyfile . . . . . . . . . . . . . . . . . . . . . . . . . 38
copies file(s); (copyfile source destination)
look . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
displays an ASCII file to screen using the ELF file
viewer; (look filespec)
movefile . . . . . . . . . . . . . . . . . . . . . . . . . 38
moves / renames file(s); (movefile source destination)
read_file . . . . . . . . . . . . . . . . . . . . . . . . . 38
reads an ASCII file and returns a string list from file
records. Each line in the text file is parsed into a
string and appended to the returned list.; (read_file
filespec mode)
ELF Documentation Table of Contents, Page vi
write_file . . . . . . . . . . . . . . . . . . . . . . . . 39
opens an ASCII file and writes a string list to the file
and then closes the file. Each string is placed in the
text file as a line of text.; (write_file filespec type)
Math Functions
| . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
returns the result of a bitwise OR of the arguments; (|
...)
|| . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
returns the result of a logical OR of the arguments; (||
...)
& . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
returns the result of a bitwise AND of the arguments; (&
...)
&& . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
returns the result of a logical AND of the arguments; (&&
...)
acos . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
returns the inverse cosine of the argument; (acos rad)
asin . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
returns the inverse sine of the argument; (asin rad)
ceil . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
returns the smallest integer greater or equal to the
argument; (ceil rval)
cosh . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
returns the hyperbolic cosine of the argument; (cosh rad)
dtr . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
converts an angle in degrees to radians; (dtr ang)
floor . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
returns the largest integer not greater than the argument;
(floor rval)
hibyte . . . . . . . . . . . . . . . . . . . . . . . . . . 42
returns the upper (most significant) byte of an integer;
(hibyte val)
lobyte . . . . . . . . . . . . . . . . . . . . . . . . . . 42
returns the lower (least significant) byte of an integer;
(lobyte val)
log10 . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
returns the logarithm to the base 10 of the argument;
(log10 x)
rand . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
generates a pseudo random number; (rand)
round . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
rounds a real value; (round val places)
rtd . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
converts an angle in radians to degrees; (rtd ang)
sinh . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
returns the hyperbolic sine of the argument; (sinh rad)
srand . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
seeds the random number generator; (srand i)
tan . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
returns the trigonometric tangent of the argument; (tan
rad)
ELF Documentation Table of Contents, Page vii
tanh . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
returns the hyperbolic tangent of the argument; (tanh rad)
List Handling Functions
bsearch . . . . . . . . . . . . . . . . . . . . . . . . . . 44
located a value in a sorted string, integer or real value
list; (bsearch vlist key)
delete . . . . . . . . . . . . . . . . . . . . . . . . . . 44
deletes a list or atom from another list; (delete list
pos)
insert . . . . . . . . . . . . . . . . . . . . . . . . . . 45
inserts a list or atom into another list; (insert list pos
item)
lfind . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
located a value in an unsorted string, integer or real
value list; (lfind vlist key)
lsearch . . . . . . . . . . . . . . . . . . . . . . . . . . 45
located a value in a string, integer or real value list;
(lsearch vlist key)
qsort . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
sorts a string, integer or real value list; (qsort lst)
replace . . . . . . . . . . . . . . . . . . . . . . . . . . 46
replace a list or atom in a list with another; (replace
list pos item)
symbol . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Displays the contents of a symbol to the screen using the
ELF file/symbol viewer.; (symbol sym)
String Handling Functions
field . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
returns a substring of str1 from token delimiters in str2
and position.; (field str1 str2 pos)
set_edit_help . . . . . . . . . . . . . . . . . . . . . . . 47
sets the user help string list for the function (strget);
(set_edit_help <slist>)
sprintf . . . . . . . . . . . . . . . . . . . . . . . . . . 47
same as printf except that nothing is printed, the string
is returned; (sprintf format ...)
strchr . . . . . . . . . . . . . . . . . . . . . . . . . . 48
finds the first occurrence of ch in str and returns a
substring starting at that character; (strchr str ch)
strcmp . . . . . . . . . . . . . . . . . . . . . . . . . . 48
compares two strings for equality (case sensitive);
(strcmp str1 str2)
strcspn . . . . . . . . . . . . . . . . . . . . . . . . . . 48
determine the length of the prefix of str1 made entirely
of chars not in str2; (strcspn str1 str2)
strdate . . . . . . . . . . . . . . . . . . . . . . . . . . 49
returns the current date from the internal clock as a
formatted string; (strdate)
strdela . . . . . . . . . . . . . . . . . . . . . . . . . . 49
delete all occurrences of chars in str2 from str1;
(strdela str1 str2)
strget . . . . . . . . . . . . . . . . . . . . . . . . . . 49
ELF Documentation Table of Contents, Page viii
edit a string on the text screen with cursor positioning
and editing, background mask, color attribute control, and
on line help.; (strget str len curpos mask attr ...)
stricmp . . . . . . . . . . . . . . . . . . . . . . . . . . 50
compares two strings for equality (case insensitive);
(stricmp str1 str2)
strncpy . . . . . . . . . . . . . . . . . . . . . . . . . . 51
copies the first n characters of a string; (strncpy str n)
strnset . . . . . . . . . . . . . . . . . . . . . . . . . . 51
fills a string; (strnset char len)
strpbrk . . . . . . . . . . . . . . . . . . . . . . . . . . 51
returns a substring of the first occurrence of any
character of str2 in str1; (strstr str1 str2)
strrchr . . . . . . . . . . . . . . . . . . . . . . . . . . 51
finds the last occurrence of ch in str and returns a
substring starting at that character; (strrchr str ch)
strrev . . . . . . . . . . . . . . . . . . . . . . . . . . 52
returns the string argument with the character order
reversed; (strrev str)
strspn . . . . . . . . . . . . . . . . . . . . . . . . . . 52
determine the length of the prefix of str1 made entirely
of chars in str2; (strspn str1 str2)
strstr . . . . . . . . . . . . . . . . . . . . . . . . . . 52
returns a substring of the first occurrence of str2 in
str1; (strstr str1 str2)
strswap . . . . . . . . . . . . . . . . . . . . . . . . . . 52
swaps all occurrences of char1 with char2 in str; (strswap
str char1 char2)
strtime . . . . . . . . . . . . . . . . . . . . . . . . . . 53
returns the current time from the internal clock as a
formatted string; (strtime)
strtok . . . . . . . . . . . . . . . . . . . . . . . . . . 53
returns the first substring of str1 from token delimiters
in str2. subsequent calls after the first with no
arguments will return the second and any further
substrings; (strtok str1 str2)
strtrim . . . . . . . . . . . . . . . . . . . . . . . . . . 53
trim white space (all char values < '!') from the
beginning (left side) and end (right side); and compresses
white space within a string to a single space between
words; (strtrim str)
strtriml . . . . . . . . . . . . . . . . . . . . . . . . . 54
trim white space from the beginning (left side) of a
string; (strtriml str)
strtrimr . . . . . . . . . . . . . . . . . . . . . . . . . 54
trim white space from the end (right side) of a string;
(strtrimr str)
tolower . . . . . . . . . . . . . . . . . . . . . . . . . . 54
; (tolower char)
toupper . . . . . . . . . . . . . . . . . . . . . . . . . . 54
; (toupper char)
Character Classification Functions
isalnum . . . . . . . . . . . . . . . . . . . . . . . . . . 55
ELF Documentation Table of Contents, Page ix
returns a non-zero value if argument is a letter or digit;
(isalnum char)
isascii . . . . . . . . . . . . . . . . . . . . . . . . . . 55
returns a non-zero value if argument is an ASCII
character; (isascii char)
iscntl . . . . . . . . . . . . . . . . . . . . . . . . . . 55
returns a non-zero value if argument is a control
character; (iscntl char)
isdigit . . . . . . . . . . . . . . . . . . . . . . . . . . 55
returns a non-zero value if argument is a numeric digit;
(isdigit char)
isgraph . . . . . . . . . . . . . . . . . . . . . . . . . . 56
returns a non-zero value if argument is a visible
printable character; (isgraph char)
islower . . . . . . . . . . . . . . . . . . . . . . . . . . 56
returns a non-zero value if argument is a lower case
letter; (islower char)
isodigit . . . . . . . . . . . . . . . . . . . . . . . . . 56
returns a non-zero value if argument is an octal digit (0-
7); (isodigit char)
isprint . . . . . . . . . . . . . . . . . . . . . . . . . . 56
returns a non-zero value if argument is a printable
character; (isprint char)
ispunct . . . . . . . . . . . . . . . . . . . . . . . . . . 57
returns a non-zero value if argument is a punctuation
character; (ispunct char)
isspace . . . . . . . . . . . . . . . . . . . . . . . . . . 57
returns a non-zero value if argument is a white-space
character (space, tab, newline, etc); (isspace char)
isupper . . . . . . . . . . . . . . . . . . . . . . . . . . 57
returns a non-zero value if argument is an upper case
letter; (isupper char)
isxdigit . . . . . . . . . . . . . . . . . . . . . . . . . 57
returns a non-zero value if argument is a hexadecimal
digit (0-F); (isxdigit char)
Utility / Miscellaneous Functions
adsdump . . . . . . . . . . . . . . . . . . . . . . . . . . 58
prints the data type and value of an AutoLISP symbol;
(adsdump sym)
beep . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
sound a beep on the PC speaker for optional frequency and
duration; (beep freq duration)
clock . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
reads the current internal clock; (clock)
exit . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
cancels execution and returns to the Command: prompt;
(exit)
getdosver . . . . . . . . . . . . . . . . . . . . . . . . . 59
returns the DOS version; (getdosver)
last_error . . . . . . . . . . . . . . . . . . . . . . . . 59
returns the last internal error message; (last_error)
nosound . . . . . . . . . . . . . . . . . . . . . . . . . . 59
turns off the PC speaker after a sound function; (nosound)
ELF Documentation Table of Contents, Page x
pause_key . . . . . . . . . . . . . . . . . . . . . . . . . 59
prints "press any key to continue..." and waits for a
keystroke; (pause_key)
sound . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
turns on the PC speaker at a specified tone frequency;
(sound freq)
system . . . . . . . . . . . . . . . . . . . . . . . . . . 60
executes a DOS command; (system cmd)
wait . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
suspend execution for a specified time duration; (wait ti)
Symbols
*last_error* . . . . . . . . . . . . . . . . . . . . . . . 60
the last error message string
color . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
default color attribute
edit_help . . . . . . . . . . . . . . . . . . . . . . . . . 60
string list with user defined help for the (strget)
function
menu_help . . . . . . . . . . . . . . . . . . . . . . . . . 60
string list with user defined help for the (wmenu)
function
Copyright . . . . . . . . . . . . . . . . . . . . . . . . . 62
Trademark . . . . . . . . . . . . . . . . . . . . . . . . . 62
Elf Documentation Page 1
Using ELF
Introduction
ELF is a library of commands and functions designed to enhance
AutoCAD and AutoLISP. The ELF library contains 15 utility and
file management commands, and over 150 functions for AutoLISP all
contained in a single EXP file.
ELF gives the AutoLISP programmer a professional programming
language rivaling many commercial compiled language libraries.
The range of functions include those for text screen video and
window control; popup menus and data entry with a build in help
system; sound; keyboard; string manipulation; math; sorting and
searching; list handling; file and directory handling; entity
creation; and several utility functions.
Non-programmers will also appreciate the mini-applications
(ELFapps), including the ELF notepad; and the several utility
commands.
In addition, ELF contains ELFDOS, which implements many DOS
commands within AutoCAD for file management, a file and symbol
browser, and integrated help.
ELF is designed to operate with AutoCAD 386 (release 10-386 and
above) on IBM PC and compatible computers under the MS/PCDOS
operating system.
ELF Features
* Over 150 new functions for AutoLISP programmers:
+ Video
- fast direct video writes to the text screen
- printf for C programmers
- color attribute control
- screen save, fill, and restore
+ Text screen windowing
- 22 functions for full window management
- multiple overlapping windows with shaded borders
and drop shadows
- menus and line editor with integrated user defined
help system
- a file dialogue
+ Cursor
- cursor positioning
- cursor size shape
+ Keyboard
- getkey, getch, getche, and kbhit functions
- keyboard status
- stuff keyboard buffer with keystrokes
+ Directory
Elf Documentation Page 2
- create / remove / change directories
- read / verify / log to all disk drives
- read disk directory and disk statistics
- copy, move, erase, and rename files.
- file path manipulation
+ File
- fast one step ASCII file read and write
+ Math
- expanded trig, logical, and bit manipulation
+ List Handling
- insert, delete, and replace items in a list
- sort and search a string, integer, or real list
- view a string list using the internal browser
+ String Handling
- full C library string scanning and manipulation
- a full featured line editor for flexible data
entry
+ Entity Creation
- fast basic entity creation in one statement using
entmake + Utility / Misc
- sound routines
- dump a list for debugging
- run other programs under program control
- clock and timer routines
* an ASCII file browser (like the shareware program LIST)
* ELFDOS - "DOS-like" file management commands from within
AutoCAD, no more shelling out to copy a file or perform
other DOS functions.
* Three useful "ELFapps" that utilize the ELF library
including:
+ NotePad - a windowed / full screen ASCII file editor
written in AutoLISP using ELF
+ Etables - an AutoCAD "stock" application modified to
utilize the ELF menus and symbol browser to display all
tables within a drawing.
+ Demo - a program the demonstrates many of the functions
of the ELF library
Elf Documentation Page 3
Installation
Copy the ELF files from the distribution diskette (or extract
them from the archive file) to any subdirectory on the AutoCAD
library path. You may place the ELF files in their own
subdirectory (eg C:\ELF) and add that directory to your AutoCAD
Library Path. To insure that AutoCAD can the find files, add the
ELF directory to your ACAD environment variable in your
AUTOEXEC.BAT or ACAD386.BAT file:
Example:
SET ACAD=C:\ACAD386\SUPPORT;C:\ELF
ACAD.ADS
If you have an ACAD.ADS file, then add ELF to that file with an
ASCII editor, or create a file named ACAD.ADS to a directory on
the library path.
Example contents release 12 ACAD.ADS file:
ACADAPP
ELF
If ELF does not load with your ACAD.ADS file then you must load
it manually:
eg: (XLOAD"ELF")
Once loaded, ELF will display the following message, and ELF
commands and functions will be available for use:
ELF vX.XX - <compile date>, Registered to: Your Name
Copyright 1992 Mountain Software. - Enter "ELF" for help:
You may add the following code to any AutoLISP program which uses
ELF to automatically xload ELF.EXP:
(if(not(member(findfile "ELF.EXP") (ADS)))
(if(not(xload"ELF" nil)) (progn
(princ "\nERROR: Unable to xload ELF.EXP")
(princ\nThis program requires ELF to operate!\007")))
)
or you can simply add (load"ELF") to your program to load ELF.EXP
and define color and key symbols.
Elf Documentation Page 4
ACAD.LSP
ELF functions can not be executed until ELF initializes. AutoCAD
does not initialize ADS programs until after ACAD.LSP loads. You
can include ELF functions in any function that you wish to
(defun) in ACAD.LSP, but they can not execute during the load.
Therefore, if you wish to execute an ELF function at entry to the
drawing editor, you can place that function into the function
(S::STARTUP) which will execute automatically after AutoCAD
initialized ELF.
Sample Programs
The following files contain "ELFapps" that demonstrate many of
the ELF functions. You may run these programs to test ELF's
features and copy portions of the code for use in your own
programs.
Filename Description
DEMO.LSP A demonstration of many of ELF's functions
NOTEPAD.LSP An ASCII file editor written in AutoLISP and ELF.
ETABLES.LSP A program which demonstrates how a "stock"
AutoLISP program (here TABLES.LSP, a sample
program included with other AutoCAD sample files)
can be easily modified using functions from ELF
and greatly improved from it's original form.
ELF.LSP defines symbols for screen attributes, border
types, keycode values, and xloads ELF.EXP if not
already loaded.
Elf Documentation Page 5
ELFDOS Commands
ELF contains many file manipulation commands equivalent to the
same commands in DOS. Many of the command names are the same as
the DOS command except that the letter "D" is added as the first
letter of the command to differentiate from similarly named
AutoCAD command (eg DCOPY for COPY).
Why not just shell to DOS?
The ELF replacements for DOS commands are faster and more
convenient. It takes time to shell to DOS and return after the
command has completed.
ELF also adds ASCII file and AutoLISP symbol viewers, and a
filefind command.
----------------------------------------
Function: cd ELF Commands
Synopsis: change directories
Aliases: chdir, dcd
Arguments: directory name
Notes: works just like the DOS chdir command except a space
or Enter is required between CD and the directory
name
Example: CD \ACAD
----------------------------------------
Function: cls ELF Commands
Synopsis: clear (erase) the text screen
Aliases:
Arguments:
Notes:
Example:
----------------------------------------
Function: c: ELF Commands
Synopsis: logs to C: drive
Aliases:
Arguments:
Elf Documentation Page 6
Notes: Similar to DOS, ELF creates a command for each valid
disk drive, therefore, if drives A:,B:,C:, and D: are
valid drives, then any of those drives can be logged
by entering its drive letter and a colon. Elf will
not log to a drive that is not ready (eg floppy drive
door open)
Example:
----------------------------------------
Function: dcopy ELF Commands
Synopsis: copy DOS file(s)
Aliases:
Arguments: from filespec to copy from (can be a wildcard)
to filename or directory to copy to
Notes: dcopy performs a "double buffered" (eg fast) file
copy and prints from and to filenames as they are
copied
Example: dcopy c:\acad\*.doc d:\temp
----------------------------------------
Function: derase ELF Commands
Synopsis: erase / delete DOS file(s)
Aliases: ddel
Arguments: filespec filespec to erase (can be a wildcard)
Notes: prints filenames as they are deleted
Example: derase c:\acad\*.bak
----------------------------------------
Function: dir ELF Commands
Synopsis: prints a file directory list
Aliases: ddir
Arguments: filespec optional wildcard filespec (eg *.DWG)
/W optional switch, prints wide (five
filenames per line)
Notes:
Example: ddir *.doc
----------------------------------------
Function: drename ELF Commands
Synopsis: rename / move file(s)
Aliases: dmove
Arguments: from filespec to move from (can be a wildcard)
to filename or directory to move to
Elf Documentation Page 7
Notes: destination must be the same device
Example: dmove c:\acad\*.doc c:\temp
----------------------------------------
Function: elf ELF Commands
Synopsis: displays a list of all ELF commands and functions
Aliases:
Arguments:
Notes: uses the ELF browser to display help for all ELF
commands and functions (see look).
Example:
----------------------------------------
Function: ff ELF Commands
Synopsis: find file(s) on the AutoCAD library path and DOS path
Aliases:
Arguments:
Notes: searches for file(s) in the following sequence:
1 - The current directory, the real current
directory, which may not be on the AutoCAD
library path if you have changed
directories after starting AutoCAD.
2 - the AutoCAD library path using AutoCAD's
(findfile) function.
3 - the DOS path
Example: ff *.sty
----------------------------------------
Function: look ELF Commands
Synopsis: display ASCII file(s) to the screen using the ELF
browser
Aliases:
Arguments: filespec file(s) to display
Elf Documentation Page 8
Notes: look loads each file matching the filespec into a
memory buffer and displays each using the internal
full screen browser. The cursor keys can be used to
view the file contents. The file can also be printed.
If no filename is specified, look will call
(wgetfile) where the user can select a file. Key
assignments in the browser are as follows:
Key Function
F1 Help
F2 text search (case insensitive)
Esc Quit all files
Q/X/E Quit / Exit file
Alt-P print the entire contents of the buffer to
PRN
Home Top of file
End Bottom of file
Up Up one line
Dn Down one line
PgUp Up one page
PgDn and
other keys Down one page
Example: look c:\acad\*.doc
----------------------------------------
Function: mkdir ELF Commands
Synopsis: create a directory
Aliases: md, dmd
Arguments: directory name
Notes:
Example: MD C:\ACAD\TEMPDIR
----------------------------------------
Function: password ELF Commands
Synopsis: register ELF with your password (obtain from Mountain
Software)
Aliases:
Arguments:
Notes: Once the elf password is entered, the delay messages
will not appear. Passwords are provided to those who
purchase ELF.
Example:
----------------------------------------
Function: rmdir ELF Commands
Synopsis: remove (delete) a directory
Aliases: rd, drd
Arguments:
Elf Documentation Page 9
Notes: the directory must be empty
Example: RD C:\ACAD\TEMPDIR
----------------------------------------
Function: sd ELF Commands
Synopsis: set default disk drive
Aliases: dsd
Arguments:
Notes: ELF also defines all valid drives as commands (eg A:,
B:, C:, D:, etc).
Example:
----------------------------------------
Function: symbol ELF Commands
Synopsis: displays the value of an AutoLISP symbol
Aliases:
Arguments: sym symbol name
Notes: (release 12 only) Symbol name can not be an AutoLISP
expression. Symbols of type Subr or Exsubr can not be
displayed. See the command "look" for a description
of the ELF browser.
Example: (setq symlist (qsort(atoms-family 1)))
symbol symlist
----------------------------------------
Function: ver ELF Commands
Synopsis: prints ELF, DOS and AutoCAD version numbers
Aliases:
Arguments:
Notes:
Example:
----------------------------------------
Elf Documentation Page 10
AutoLISP Functions
Optional Parameters
The ELF library utilizes optional parameters for many of its
functions. Optional parameters assume a default value when no
specific value is specified in the function call. For example,
the ELF function (beep) with no parameters will sound the PC
speaker at a frequency of 440 hertz for 0.5 seconds by default.
Or, you can specify the frequency alone (beep 800) or the
frequency and time, (beep 800 1.0). You can not, however, specify
the second parameter without specifying the first.
Variable Parameters
Some functions also accept a variable number of parameters. For
example, the function (printf format ...) requires a format
parameter, but additional parameters are required only if the
format contains variable specifier. (printf "\nHello World")
requires only the format parameter but (printf "Name: %10.10s,
Age: %2d" name age) requires two additional parameters to supply
the required values.
Data Types
The following pneumonics are used to denote data types in ELF
functions.
Pneumonic Data Type Description
-------------------------------------------------------------
<int> integer signed short Integer
<real> real double precision float
<str> string character string
<char> integer a character ascii value
<list> list AutoLISP list
<slist> string list list of strings
<fspec) string filespec string
<path> string directory path
<drive> string single character string drive letter
<dir> string directory
<fn> string file name
<ext> string file extension
<disk> integer integer disk number (A=1)
<col> integer screen column (X) position
<row> integer screen row (Y) position
<attr> integer screen color attribute
<pt> point a list of two or three reals
<cen> point "
<rad> real radius units
<ang> real angle in radians
<layer> string an AutoCAD layer
<symbol> symbol an AutoLISP symbol (atom or list)
ELF Functions page 11
Return Values
ELF functions can return any of the primary data types (eg int,
real, string, and nil) and lists. AutoCAD 386 does not support a
long integer data type, therefore some ELF functions that would
return a long will return a real value. The function (rand)
returns real values from a long integer result.
Many functions return lists of values. The values of the list can
be retrieved using (nth) as well as (car), (cdr), and up to four
levels of concatenations of (car) and (cadr) as follows:
(nth 0 lst) (car list) ;first element
(nth 1 lst) (cadr list) ;second element
(nth 2 lst) (caddr list) ;third element
(nth 3 lst) (cadddr list) ;fourth element
(nth 4 lst) (caddddr list) ;fifth element
(nth 5 lst) ;fifth element, etc
Many functions that are converted C functions will return nil
instead of 0 to indicate a False result. This allows testing for
falsity in one step. For example:
(if(isascii ch)(doit))
is much simpler than:
(if(/= 0 (isascii ch))(doit))
Video Functions
The ELF video system is a collection of fast and flexible
functions that write directly to the text screen video screen
buffer.
The function printf, from of the C function library, is included
in two forms. The first, (printf) uses the AutoCAD internal
printf function. Text printed with this function will "stick" if
the user presses <F1> to flipscreen to the graphics screen and
back to the text screen. AutoCAD uses it's own text screen buffer
to save the screen on a single monitor setup.
The function (scr_printf), as well as many of the other screen
write functions, writes directly to the video buffer, and is not
saved to AutoCAD's internal buffer. It is much faster, but will
disappear when the user flips screen to the graphics screen and
then returns to the text screen. (scr_printf) also prints using a
color attribute.
The color attribute is set with the (set_color) function or, in
release 12 the symbol "color" can be set to the selected color
attribute. The internal color variable is also used by the other
ELF Functions page 12
screen write functions if no color attribute is specified in the
optional attribute function parameter. The file COLORS.LSP
contains symbolic names for the color attributes and can be
loaded within any AutoLISP program to define the color symbols.
----------------------------------------
Function: box Video
Synopsis: draws a box (rectangle) on the text screen using
graphic ascii characters.
Prototype: (box col row ecol erow attr btype)
Arguments: <int> col upper left corner column position
<int> row upper left corner row position
<int> ecol lower right corner
column position
<int> erow lower right corner row
position
<int> attr optional color
attribute [default
color symbol]
<int> btype optional border type
[default single line]
Returns: none
Notes: does not erase the area inside the box
Example: (box 10 2 70 18 23 1)
----------------------------------------
Function: cls Video
Synopsis: clear text screen to optional color attribute
Prototype: (cls attr)
Arguments: <int> attr optional color
attribute
Returns: none
Notes:
Example: (cls 23) ;;; clear screen using light grey on blue
attribute
----------------------------------------
Function: get_video Video
Synopsis: get current text screen video parameters
Prototype: (get_video)
Arguments: none
ELF Functions page 13
Returns: <list>
cols <int> width of text screen
(usually 80)
rows <int> height of text screen
(usually 25)
mode <int> video mode
page <int> video page
Notes:
Example: (setq vid (get_video)
cols (car vid)
rows (cadr vid))
----------------------------------------
Function: printf Video
Synopsis: formatted "C" type print to text screen or graphics
command prompt area
Prototype: (printf format ...)
Arguments: format <string> conversion
specification string
Returns: ... a <string>, <int> or
<float> arguments for
each format specifier
in the format parameter
Notes: see a "C" language text or compiler library
documentation
Example: (printf "%-10s%10.2f %d" strvar floatvar intvar)
----------------------------------------
Function: prts Video
Synopsis: fast write to text screen at col, row position with
optional attribute
Prototype: (prts col row string attr)
Arguments: col <int> screen column position
row <int> screen row position
string <str> text string
attr <int> optional color
attribute
Returns: none
Notes: uses direct video buffer write for speed
Example: (prts 40 10 "Hello World" 23)
----------------------------------------
Function: puts Video
Synopsis: fast write to text screen at cursor position with
optional attribute
Prototype: (puts string attr)
ELF Functions page 14
Arguments: string <str> text string
attr <int> optional color
attribute
Returns: none
Notes: uses direct video buffer write for speed
Example: (puts "Hello World" 23)
----------------------------------------
Function: restore_screen Video
Synopsis: restores a previously captured text screen
Prototype: (restore_screen)
Arguments: none
Returns: 1 if successful, nil otherwise
Notes: the cursor position and size are not restored (use
get_cursor/set_cursor)
Example: see save_screen
----------------------------------------
Function: save_screen Video
Synopsis: captures the contents of the text screen to a memory
buffer
Prototype: (save_screen)
Arguments: none
Returns: 1 if successful, nil otherwise
Notes: only one buffer is allocated, subsequent use will
overwrite any previous contents of the buffer
Example: (save_screen) ;;; take a picture of
the screen
;;; do something that messes up the screen
(restore_screen) ;;; put it back the way
that it was
----------------------------------------
Function: scr_fill Video
Synopsis: fill a rectangle of the text screen with a character
and color attribute
Prototype: (scr_fill col row cols rows ch attr)
Arguments: col <int> upper left column
position
row <int> upper left row position
cols <int> lower right column
position
rows <int> lower right row
position
ch <int> character as an integer
attr <int> color attribute
Returns: none
ELF Functions page 15
Notes:
Example: (setq vid (get_video) vcols (car vid) vrows (cadr
vid))
(scr_fill 0 0 vcols vrows (ascii "░") 23) ;;;
fill entire screen with patterned
lightgrey on blue
----------------------------------------
Function: scr_printf Video
Synopsis: formatted "C" type print to text screen using direct
video buffer write
Prototype: (scr_printf format ...)
Arguments: format <string> conversion
specification string
Returns: ... any number of <string>,
<int> or <float>
arguments
Notes: see a "C" language text or compiler library
documentation
Example: see printf
----------------------------------------
Function: set_color Video
Synopsis: sets the internal "color" variable for use by
subsequent uses of routines which can use the default
color (r11)
Prototype: (set_color attr)
Arguments: attr <int> color attribute
Returns: for release 12 the AutoLISP symbol COLOR is used to
set the default color
Notes: (set_color 23)
Example:
----------------------------------------
Cursor Functions
The cursor functions provide a means to control the location and
appearance of the screen cursor. Several of the video screen
write functions print at the cursor location, (gotoxy) positions
the cursor and (getxy) returns the current cursor location.
(get_cursor) returns the cursor shape and (set_cursor) sets the
cursor shape (start and ending scan lines). (set_cursor 32 0)
will also hide the cursor.
----------------------------------------
ELF Functions page 16
Function: get_cursor Cursor
Synopsis: get cursor size / shape
Prototype: (get_cursor)
Arguments:
Returns: <list>
start <int> start scan line
end <int> end scan line
Notes:
Example: (setq save_cur (get_cursor)) ;;; save cursor shape
----------------------------------------
Function: getxy Cursor
Synopsis: get cursor screen coordinates
Prototype: (getxy)
Arguments:
Returns: <list>
col <int> screen column position
row <int> screen row position
Notes:
Example: (setq pos (getxy) col (car pos) row (cadr pos))
----------------------------------------
Function: gotoxy Cursor
Synopsis: position the screen cursor
Prototype: (gotoxy col row)
Arguments: col <int> screen column (x)
position
row <int> screen row (y) position
Returns:
Notes:
Example: (gotoxy 0 0) ;;; home cursor
----------------------------------------
Function: set_cursor Cursor
Synopsis: set cursor size; start to end scan lines
Prototype: (set_cursor start end)
Arguments: start <int> start scan line
end <int> end scan line
Returns:
ELF Functions page 17
Notes: full cursor size is different depending on video
mode, the CGA cursor is 8 scan lines high, the
monochrome ,EGA, and VGA cursors are 14 scan lines
high. Specifying 32 as the start scan line will hide
the cursor.
Example: (set_cursor 0 13) ;;; full block cursor
(set_cursor 12 13) ;;; normal cursor
(set_cursor 32 0) ;;; hide cursor
----------------------------------------
Window Functions
The ELF text screen window system rivals many commercial compiled
language function libraries. It provides the programmer with the
tools to produce a professional "look and feel" to AutoLISP
programs.
When a window is opened, the screen text under the window and its
border and shadow are saved. When the window is closed the screen
is restored to its previous state. There is no practical limit to
the number of windows open at on time.
Only the topmost window can be written to using the window
writing routines (eg wputs, wprts, etc). If you wish to write to
a window other than the topmost window, you can do so, but you
must use the screen writing routines, calculate cursor position,
and otherwise maintain the window yourself.
When no color attribute is specified in a window write function,
the window attribute will be used by default, not the symbol
"color" as used by screen writing functions.
----------------------------------------
Function: set_menu_help Window
Synopsis: sets the user help string list for wmenu
Prototype: (set_menu_help <slist>)
Arguments: <slist> a string list to be displayed when the F1
key is pressed while in (wmenu). The first
item in the list will be the help window
title.
Returns:
ELF Functions page 18
Notes: In release 12 or higher the symbol MENU_HELP can be
used to set the help string. In release 12
(set_menu_help) will also set this symbol. The symbol
MENU_HELP can be local to a particular function or
global in scope.
The user can display the default help screen by
pressing F1 the second time.
Example: (set_menu_help '("[ My Help Screen ]" "" "This is my
help message"))
----------------------------------------
Function: wclose Window
Synopsis: closes the top window restoring the screen under the
window
Prototype: (wclose)
Arguments: none
Returns: number of remaining open windows if successful or nil
Notes:
Example:
----------------------------------------
Function: wcloseall Window
Synopsis: closes all windows
Prototype: (wcloseall)
Arguments: none
Returns:
Notes: use at the end of programs to close any remaining
open windows
Example:
----------------------------------------
Function: wclreol Window
Synopsis: erase from window cursor to end of line
Prototype: (wclreol)
Arguments:
Returns: none
Notes:
Example:
----------------------------------------
Function: wcls Window
Synopsis: clear window to optional color attribute
Prototype: (wcls attr)
ELF Functions page 19
Arguments: <int> attr optional color
attribute
Returns: none
Notes:
Example: (wcls 23) ;;; clear window using light grey on blue
attribute
----------------------------------------
Function: werase_line Window
Synopsis: erase a line of text from a window
Prototype: (werase_line line)
Arguments: line <int> window row to erase
Returns: none
Notes:
Example: (werase_line 2) ;;; erase line 2
----------------------------------------
Function: wgetstr Window
Synopsis: open a window centered on the text screen, prints a
prompt on the top border and gets string input.
Prototype: (wgetstr prompt default length wattr battr btype)
Arguments: prompt <string> prompt string
default <string> optional default string
/ string to edit
len <int> optional string length
(default = 78)
wattr <int> optional window
attribute (default =
color symbol)
battr <int> optional border
attribute (optional =
wattr)
btype <int> optional border type
(default = double)
Returns: the edited string or nil if the string is empty
Notes: see strget and wpopup
Example: (wgetstr "Enter text" "Hello World" 60 23 23 33)
----------------------------------------
Function: wgetdrive Window
Synopsis: select a disk drive from a menu, all valid drives are
listed with their respective drive type (eg
removable/floppy, fixed, network, and redirected
devices)
Prototype: (wgetdrive col row wattr battr hattr btype)
ELF Functions page 20
Arguments: col <int> optional upper left
column position
(default = centered)
row <int> optional upper left row
position (default =
centered)
wattr <int> optional window
attribute (default =
color variable)
battr <int> optional border
attribute
hattr <int> optional highlight
(cursor) bar attribute
btype <int> optional border type
Returns: the disk drive as an integer (A:=1, B:=2, etc)
Notes:
Example: (setq drive (wgetdrive 10 5))
----------------------------------------
Function: wgetfile Window
Synopsis: select a file from a menu of DOS files from the
current directory. The user can change directories
and access all available disk drives.
Prototype: (wgetfile filespec fileattr col row wattr battr hattr
btype)
Arguments: filespec <string> wildcard filespec (eq
*.DAT)
fileattr <int> file attribute mask
(see findfirst)
col <int> optional upper left
column position
(default = -1 centered)
row <int> optional upper left row
position (default = -1
centered)
wattr <int> optional window
attribute (default =
color variable)
battr <int> optional border
attribute
hattr <int> optional highlight
(cursor) bar attribute
btype <int> optional border type
Returns: the full qualified pathname of the selected file or
nil if <Esc> is pressed.
Notes: The drive select menu is activated by pressing <Alt-
D>.
Example: (setq filename (wgetfile "*.TXT" 33 -1 -1 23 23 70
17)
----------------------------------------
ELF Functions page 21
Function: wgetxy Window
Synopsis: get window screen position
Prototype: (wgetxy)
Arguments: none
Returns: <list>
col <int> window column position
row <int> window row position
Notes:
Example: (setq
wcur (getxy)
wcol (car wcur) ;;; cursor column
wrow (cadr wcur) ;;; cursor row
)
----------------------------------------
Function: wgotoxy Window
Synopsis: move window cursor
Prototype: (wgotoxy col row)
Arguments: col <int> window column position
row <int> window row position
Returns: none
Notes:
Example: (wgotoxy 0 0) ;;; home cursor in window
----------------------------------------
Function: winfo Window
Synopsis: gets the top window size and position
Prototype: (winfo)
Arguments: none
Returns: <list>
col <int> upper left column
position
row <int> upper left row position
cols <int> lower right column
position
rows <int> lower right row
position
Notes:
Example: (setq w (winfo)
wcol (car w)
wrow (cadr w)
wcols (caddr w)
wrows (cadddr w))
----------------------------------------
ELF Functions page 22
Function: wmenu Window
Synopsis: opens a centered window and displays a menu. The user
can then select one of the displayed items.
Prototype: (wmenu slist wattr battr hattr btype shadow title)
Arguments: slist <list> list of strings to
display in the menu
col <int> optional upper left
column position
(default = centered)
row <int> optional upper left row
position (default =
centered)
wattr <int> optional window color
attribute (default =
"color" symbol)
battr <int> optional border
attribute (default =
wattr)
hattr <int> optional highlight bar
attribute (default =
reversed wattr)
btype <int> optional border type
(default = double line)
title <string> optional window title
Returns: <list>
<int> 0 based item number selected
<int> keycode of key pressed to exit menu
ELF Functions page 23
Notes: If the list of items is longer that can be displayed
in one window then the user can page through the list
with the cursor keys. Keys are as follows:
Key Meaning
<Up> move cursor up
<Down> move cursor down
<PgUp> move up one page
<PgDn> move down one page
<Enter> exit
<Ctrl-Enter> exit
<Esc> exit
<F1> Display help screen. If the symbol
MENU_HELP is defined, its contents will be
displayed. The function (set_menu_help)
can be used to set MENU_HELP in release 10
or 11. The user can press F1 the second
time to display the default help text.
<End> move to last item
<Home> move to first item
<char> any alphanumeric key will move the cursor
to the next item starting in that
character
Example: (setq
item (wmenu '("Yes" "No") 23 23 1 1 "?"))
yn (car item)
key (cadr item)
)
(if(/= key EscKey) (doit) (exit))
----------------------------------------
Function: wmsg Window
Synopsis: opens a centered window, displays a message and
optionally waits for a keystroke and closes the
window
Prototype: (wmsg str wait attr battr btype)
Arguments: str <string> the message string
wait <int> optional, 1 = wait for
a keystroke then close
window (default) else
leave window open
wattr <int> optional window color
attribute (default =
color symbol)
wattr <int> optional border color
attribute (default =
wattr)
btype <int> optional border type
(default = double line
with drop shadow)
Returns: if wait=1 then keycode entered to close window is
returned
ELF Functions page 24
Notes:
Example: (setq key (wmsg "Continue ?[Y/N]" 1 23 23 1))
----------------------------------------
Function: wopen Window
Synopsis: open a window on the text screen with specified
location, size, border, and colors; saving the area
under the window
Prototype: (wopen col row cols rows wattr battr btype)
Arguments: col <int> upper left column
position (-1 =
centered)
row <int> upper left row position
(-1 = centered)
cols <int> number of columns
(including border)
rows <int> number of rows
(including border)
wattr <int> optional window
attribute (default =
color variable)
battr <int> optional border
attribute
btype <int> optional border type:
Type Meaning
0 no border
1 single line
2 double line
3 double vertical
4 double horizontal
5 solid
btype + 8 = hilight upper left sides of border for
raised effect
btype + 16 = hilight lower right sides of border
btype + 32 = add drop shadow to right and lower sides
of window
Returns: <int> the number of windows currently open
Notes: flips screen to the text screen
Example: (wopen 20 5 40 10 23 23 2)
----------------------------------------
Function: wpopup Window
Synopsis: open a window centered on the text screen
Prototype: (wpopup cols rows wattr battr)
ELF Functions page 25
Arguments: cols <int> number of column wide
(including border)
rows <int> number of rows high
(including border)
wattr <int> optional window
attribute (default =
color symbol)
battr <int> optional border
attribute (optional =
wattr)
btype <int> optional border type
(default = double)
Returns: the number of windows currently open
Notes:
Example: (wpopup 40 10 23 23)
----------------------------------------
Function: wprintf Window
Synopsis: printf to window at window cursor position
Prototype: (wprintf format ...)
Arguments: see printf
Returns:
Notes: see printf
Example:
----------------------------------------
Function: wprts Window
Synopsis: write to window at col, row position with optional
attribute
Prototype: (wprts col row string attr)
Arguments: col <int> window column position
row <int> window row position
string <str> text string
attr <int> optional color
attribute
Returns: none
Notes:
Example: (wprts 0 3 "Hello World" 23)
----------------------------------------
Function: wputcen Window
Synopsis: write a centered string to window at window cursor
row position
Prototype: (wputcen str)
Arguments: str <string> the string to print
Returns:
ELF Functions page 26
Notes: cursor column position is ignored and the string is
centered within the window
Example:
----------------------------------------
Function: wputs Window
Synopsis: write to window at window cursor position with
optional attribute
Prototype: (puts string attr)
Arguments: string <str> text string
attr <int> optional color
attribute
Returns: none
Notes:
Example: (wputs "Hello World" 23)
----------------------------------------
Function: wscroll Window
Synopsis: scroll window text
Prototype: (wscroll dir start end lines)
Arguments: dir <int> direction; 0 = up
(default), 1 = down
start <int> start row to scroll
(default = 0)
end <int> end row (default =
last window row)
line <int> optional number of
lines to scroll
(default = 1)
Returns: none
Notes:
Example: (wscroll) ;;; scroll entire window up 1 line
(wscroll 1 0 2 1) ;;; scroll first 3 window rows up 1
line
----------------------------------------
Function: wshadow Window
Synopsis: adds a drop shadow to the top (last opened) window
Prototype: (wshadow attr)
Arguments: attr <int> color attribute
(default lightgrey on
black)
Returns:
ELF Functions page 27
Notes:
Example: (wshadow 23)
----------------------------------------
Function: wtitle Window
Synopsis: prints on the border of a window in one of 6
positions
Prototype: (wtitle <str> [<pos>])
Arguments: str <string> title message
pos <int> optional position to
place string
Value Meaning
0 top left (default)
1 top center
2 top right
3 bottom left
4 bottom center
5 bottom right
Returns:
Notes: If no windows are open wtitle has no effect. Titles
will be trimmed to fit available space on the border.
Example: (wtitle "My Window" 1)
----------------------------------------
Keyboard Functions
The ELF keyboard functions add both C library functions to read a
character from the keyboard and functions to read the keyboard
directly. The function (getkey) returns a unique value for each
key on the PC keyboard. The file ELF.LSP contains symbols for
many (but not all) of the PC function and control keys. You can
determine the value of any key by entering (getkey) at the
Command: prompt and then pressing the desired key.
The function (key_stuff) provides a means to control other
programs when no other means exists to execute a command or feed
data to another command or program. The function is limited to 15
characters unless you have installed a TSR keyboard handler or
driver which expands the size of the PC keyboard buffer.
----------------------------------------
Function: getch Key
Synopsis: get a character from the keyboard
Prototype: (getch)
Arguments:
Returns: <int> key character as an integer
ELF Functions page 28
Notes:
Example: (setq char (chr(getch))) ;;; character as a string
----------------------------------------
Function: getche Key
Synopsis: get a character from the keyboard with echo
Prototype: (getche)
Arguments:
Returns: <int> key character as an integer
Notes: see getch
Example:
----------------------------------------
Function: getkey Key
Synopsis: get a keystroke from the keyboard
Prototype: (getkey)
Arguments:
Returns: <int> keycode The lower byte of
keycode contains the
key character and the
upper byte contains the
keyboard scancode.
Notes: The value returned by getkey is unique for (nearly)
every key on the PC keyboard. The file KEYS.LSP
contains a list of keycodes of cursor movement and
function keys. The keycode of any key can be
determined by executing (getkey) interactively.
Example: (setq
c (getkey) ;;; the keycode
char (chr(lobyte c)) ;;; key character as a
string
scode (hibyte c) ;;; keyboard scan code
)
----------------------------------------
Function: kbhit Key
Synopsis: checks the keyboard buffer for a waiting keystroke
Prototype: (kbhit)
Arguments:
Returns: a non-zero value if a key is waiting
Notes:
Example: (while (not(kbhit)))
----------------------------------------
ELF Functions page 29
Function: key_clear Key
Synopsis: clears the keyboard buffer of any pending keystrokes
Prototype: (key_clear)
Arguments:
Returns:
Notes:
Example: (key_clear) ;;; clear the keyboard
(setq key (getkey)) ;;; get a keystroke
----------------------------------------
Function: key_ready Key
Synopsis: returns immediately with a waiting key
Prototype: (key_ready)
Arguments:
Returns: <int> key or nil
Notes: key_ready checks the keyboard buffer and immediately
returns the next keycode (leaving it in the buffer)
or nil if no key is waiting
Example: (while (not(key_ready)))
----------------------------------------
Function: key_stat Key
Synopsis: gets the state of keyboard shift and other special
keys
Prototype: (key_stat)
Arguments:
Returns: <int> a bit coded field as follows:
Bit Mask Meaning
0 1 Right shift key pressed
1 2 Left shift key presses
2 4 Ctrl key pressed
3 8 Alt key pressed
4 16 ScrollLock On
5 32 NumLock On
6 64 Capslock On
7 128 Insert On
Notes:
Example:
----------------------------------------
Function: key_stuff Key
Synopsis: "pushes" keys into the keyboard buffer
Prototype: (key_stuff str)
Arguments: str <string> up to 15 characters
Returns:
ELF Functions page 30
Notes: stuffs the keyboard buffer to control "ill behaved"
programs. The DOS keyboard buffer can hold a maximum
of 15 keys, additional keys are ignored.
Example: (key_stuff ".QUIT\nY\n")
----------------------------------------
Directory Functions
Elf contains a full suite of functions to read and manipulate the
DOS file directory system. In addition to C library functions,
ELF provides macro functions to return a list of valid disk
drives, directories, and files.
----------------------------------------
Function: access Directory
Synopsis: determines if a file exists and can be accessed by
mode
Prototype: (access path mode)
Arguments: <string> path
<int> mode:
Value Test For
0 existence only
1 read permission
2 write permission
3 read and write permission
Returns: 1 if true, nil otherwise
Notes:
Example: (access "C:\ACAD\FOO.DAT" 2) ;;;checks for the
existence and write
permission
----------------------------------------
Function: chdir Directory
Synopsis: change disk directory
Prototype: (chdir path)
Arguments: path <string> DOS path
Returns: <string> current directory after successful
execution or nil otherwise.
Notes: If a drive different from the current drive is
specified, the directory on the specified drive will
be changed. Does not log to a different drive.
Example: (chdir "\acad\dwgs")
----------------------------------------
ELF Functions page 31
Function: chpath Directory
Synopsis: change current disk drive and directory
Prototype: (chpath path)
Arguments: path <string> DOS path including
drive letter
Returns: <string> current directory after successful execution
or nil otherwise.
Notes:
Example: (chpath "d:\dwgs")
----------------------------------------
Function: disk_ready Directory
Synopsis: verifies that a removable (floppy) drive is ready and
readable
Prototype: (disk_ready drive)
Arguments: drive <int> drive to check (1=A:,
2=B:, etc)
Returns: 1 if true or nil otherwise
Notes:
Example: (disk_ready 1) ;;; verify that drive A: is ready
----------------------------------------
Function: disk_type Directory
Synopsis:
Prototype: (disk_type drive)
Arguments: drive <int> drive to check (1=A:,
2=B:, etc)
Returns: 0 removable (floppy) disk
1 fixed (hard) disk
2 network drive
3 redirected device
nil invalid drive
Notes:
Example:
----------------------------------------
Function: disk_valid Directory
Synopsis: verifies that a disk drive is a valid device (but not
necessarily ready if a removable/floppy drive)
Prototype: (disk_valid drive)
Arguments: drive <int> drive to check (1=A:,
2=B:, etc)
Returns: 1 if true or nil otherwise
ELF Functions page 32
Notes:
Example: (disk_valid 6) ;;; verify that drive F: is valid
----------------------------------------
Function: erasefile Directory
Synopsis: erase file(s)
Prototype: (erasefile filename)
Arguments: filename <string> - file to erase
Returns: 1 - success
0 - fail
Notes:
Example: (erasefile "thisfile.dat")
----------------------------------------
Function: file_exists Directory
Synopsis: determines if a file exists
Prototype: (file_exists path)
Arguments: <string> path
Returns: 1 if true, nil otherwise
Notes:
Example: (file_exists "C:\ACAD\FOO.DAT")
----------------------------------------
Function: findfirst Directory
Synopsis: finds the first instance of a file who's name and
directory attributes match the arguments.
Prototype: (findfirst filespec attribute)
ELF Functions page 33
Arguments: filespec <string> optional - a filespec
which can include
wildcard characters in
the file specification
(default *.*)
attribute <integer> optional - a value
between 0 and 255.
(default 33) The
following values can be
ORed or added to
produce the needed
attribute.
Value Attribute
1 Archive file
4 Hidden file
8 Normal file
16 Read only file
32 System file
64 Subdirectory
128 Volume ID
Returns: an AutoLISP list if successful or nil otherwise.
filename <string> includes file extension
filesize <string> size of the file in bytes.
date <string> the file date
time <string> the file time
attribute <int> the files' attribute
Example: ("FILENAME.EXT" "134562" "3/31/92" "11:21a"
9)
Notes: Findfirst allows you to use the * and ? wildcard
characters to search the file system directory
structure. If the file is found then the function
returns information about the file in an AutoLISP
list. If the attribute parameter is 255 then all
files and directories will match the attribute. The
combination of attribute = 255 and wildcard = "*.*"
will match all files, all directories, and the volume
id if it exists from the current subdirectory.
Files with no attributes will always be returned.
Therefore in order to retrieve only directories then
files with an attribute value of 0 must be filtered
out.
Example: (findfirst "*.DWG" 1+8+16)
----------------------------------------
Function: findnext Directory
Synopsis: finds the next occurrence of the file specification
and attribute after a findfirst call
Prototype: (findnext)
ELF Functions page 34
Arguments: none
Returns: AutoLISP list for the file. (see findfirst)
Notes:
Example: (setq fn (findfirst 33 "*.DAT"))
(while (boundp 'fn))
(printf "\n%s" (car fn)))
(setq fn (findnext)
)
----------------------------------------
Function: fullpath Directory
Synopsis: expands a partial path into a full DOS path string
Prototype: (fullpath path)
Arguments: path <string> a relative or partial path string (eg
"c:filename.ext"
Returns: <string> the full path string (eg
"C:\ACAD\FILENAME.EXT")
Notes: the file does not have to exist
Example: (fullpath "D:FILE.DAT") ;;; might return
"D:\DIR1\FILE.DAT
----------------------------------------
Function: getdir Directory
Synopsis: returns a string with the current drive:\path
Prototype: (getdir)
Arguments: none
Returns: <string> current directory path
Notes:
Example: (setq curdir (getdir))
----------------------------------------
Function: getdiskfree Directory
Synopsis: returns size statistics in the specified drive number
as a list
Prototype: (getdiskfree 3)
Arguments: <int> drive number (Current=0, A=1, B=2, C=3, etc)
Returns: <list>(<int> total bytes <int> free bytes <int>
sector size <int> sectors per cluster)
Notes:
Example: (setq dstat (getdiskfree 0)
sector (cadddr dstat)
cluster (* sector (caddr dstat))
drive_bytes (* cluster (car dstat))
free_bytes (* cluster (cadr dstat))
)
----------------------------------------
ELF Functions page 35
Function: getdisk Directory
Synopsis: returns the current drive number (A=1, B=2, C=3, etc)
Prototype: (getdisk)
Arguments: none
Returns: <int> current drive
Notes:
Example: (setq DriveStr (sprintf "%c:" (+(getdisk)(1-(ascii
"A"))))
----------------------------------------
Function: load_dirs Directory
Synopsis: returns a list of strings containing file directories
from the current directory
Prototype: (load_dirs)
Arguments: none
Returns: <list> A list of directories if successful or nil
otherwise
Notes: uses DOS findfirst and findnext
Example: (setq dirs (load_dirs))
----------------------------------------
Function: load_drives Directory
Synopsis: returns a list of strings containing all valid disk
drives
Prototype: (load_drives)
Arguments: none
Returns: <list> A list of drives if successful or nil
otherwise
Notes:
Example: (setq drives (load_drives))
----------------------------------------
Function: load_files Directory
Synopsis: returns a list of strings containing files matching a
filespec and directory attribute
Prototype: (load_files filespec attribute)
Arguments: <string> filespec optional path and file
specification, default:
"*.*"
Returns: <int> attribute optional bit coded file
attributes (see
findfirst), default: 33
<list> A list of files if successful or nil otherwise
ELF Functions page 36
Notes:
Example: (setq files (qsort(load_files "D:\DWGS\*.DWG")))
----------------------------------------
Function: makepath Directory
Synopsis: Combines the four components into a full DOS path
string
Prototype: (makepath drive dir name ext)
Arguments: see (splitpath)
Returns: <string> full path string
Notes:
Example: (makepath "D:" "\ACAD\SUPPORT\" "ACAD" ".LSP")
----------------------------------------
Function: mkdir Directory
Synopsis: creates a new directory
Prototype: (mkdir dirname)
directory <string> directory to create
Arguments: <string> directory name if successful or nil
otherwise
Returns:
Notes: (mkdir "\newdir")
Example:
----------------------------------------
Function: rmdir Directory
Synopsis: removes (deletes) a directory
Prototype: (rmdir dirname)
Arguments: directory <string> directory to remove
Returns: <string> current directory if successful or nil
otherwise
Notes:
Example: (rmdir "\olddir")
----------------------------------------
Function: setdisk Directory
Synopsis: logs to the specified disk drive
Prototype: (setdisk drive)
Arguments: drive <int> drive number (A=1, B=2,
C=3, etc)
Returns: <int> current drive if successful or nil
Notes:
Example: (setdisk 3) ;;; make drive C: current
----------------------------------------
ELF Functions page 37
Function: splitpath Directory
Synopsis: splits a DOS path string into its four components
Prototype: (splitpath path)
Arguments: path <string> full DOS path to a file
Returns: a <list> containing four strings:
drive the drive character followed by a ':' (eg
"C:")
dir the directory (eg "\ACAD\SUPPORT"
name the name of the file (eg "ACAD")
ext a period followed by the file extension
(eg ".LSP")
Notes:
Example: (setq
plist (splitpath "D:\ACAD\SUPPORT\ACAD.LSP")
drive (car plist) ;;; "D:"
dir (cadr plist) ;;; "\ACAD\SUPPORT\"
name (caddr plist) ;;; "ACAD"
ext (cadddr plist) ;;; ".LSP"
)
----------------------------------------
Function: unlink Directory
Synopsis: erase file(s)
Prototype: (unlink filename)
Arguments: filename <string> - file to erase
Returns: 1 - success
0 - fail
Notes: unlink and erasefile are identical
Example: (unlink "thisfile.dat")
----------------------------------------
File Functions
ELF contains file handling functions to speed file handling.
AutoLISP provides functions to read and write to text files a
character and a line at a time. ELF adds functions to read and
write the entire file in one step.
The function (read_file) will return the contents of an entire
file and can be used to quickly load the contents of the file
into an AutoLISP symbol. (write_file) inverses the process and
will write the entire contents of an AutoLISP string list to a
file. These functions are much faster than looping through a list
and reading/writing a line at a time with AutoLISP.
----------------------------------------
ELF Functions page 38
Function: copyfile File
Synopsis: copies file(s)
Prototype: (copyfile source destination)
Arguments: <string> source path
<string> destination path
Returns: number of files copied if successful, nil otherwise
Notes: The destination can be a either a file or directory.
Both input and output streams are buffered to improve
copy speed.
Example: (copyfile "C:\ACAD\*.DAT" "D:")
----------------------------------------
Function: look File
Synopsis: displays an ASCII file to screen using the ELF file
viewer
Prototype: (look filespec)
Arguments: <filespec> filename or wildcard filespec to view
Returns: 1 if successful, nil otherwise
Notes:
Example: (look "C:\ACAD\*.DOC"
----------------------------------------
Function: movefile File
Synopsis: moves / renames file(s)
Prototype: (movefile source destination)
Arguments: <string> source path
<string> destination path
Returns: number of files moved if successful, nil otherwise
Notes: destination must be on the same drive
Example: (movefile "C:\ACAD\*.DAT" "C:\DATDIR")
----------------------------------------
Function: read_file File
Synopsis: reads an ASCII file and returns a string list from
file records. Each line in the text file is parsed
into a string and appended to the returned list.
Prototype: (read_file filespec mode)
Arguments: <string> filespec file specification of
the file to read
<int> mode type of list to create
(see return value)
ELF Functions page 39
Returns: <list> A list whose contents are dependant on
mode
Value Meaning
0 or nil A list of strings
1 A list of dotted pairs containing a 0
based sequential value and a string
Notes: The dotted pair list can be accessed randomly using
the (assoc) function.
Example: (read_file "FOO.BAR" 1)
----------------------------------------
Function: write_file File
Synopsis: opens an ASCII file and writes a string list to the
file and then closes the file. Each string is placed
in the text file as a line of text.
Prototype: (write_file filespec type)
Arguments: <string> filespec file specification of
the file to write
<string> type how the file will be
opened, "a" appends to
the end of the file,
otherwise a new file
will be created and any
other character is
ignored.
<list> A list of strings
Returns: <int> the number of lines written
Notes:
Example: (write_file "FOO.BAR" "a" "This is data") ;;; appends
a line to file FOO.BAR
----------------------------------------
Math Functions
ELF expands the AutoLISP math library with additional math, trig,
and logical functions.
----------------------------------------
Function: | Math
Synopsis: returns the result of a bitwise OR of the arguments
Prototype: (| ...)
Arguments: ... <int> any number of integer
values
Returns: <int> the result of the bitwise OR
Notes:
Example: (setq color (| lgrey blue_bg))
----------------------------------------
ELF Functions page 40
Function: || Math
Synopsis: returns the result of a logical OR of the arguments
Prototype: (|| ...)
Arguments: ... <int> any number of integer
values
Returns: <int> the result of the logical OR
Notes:
Example:
----------------------------------------
Function: & Math
Synopsis: returns the result of a bitwise AND of the arguments
Prototype: (& ...)
Arguments: ... <int> any number of integer
values
Returns: <int> the result of the bitwise AND
Notes:
Example:
----------------------------------------
Function: && Math
Synopsis: returns the result of a logical AND of the arguments
Prototype: (&& ...)
Arguments: ... <int> any number of integer
values
Returns: <int> the result of the logical AND
Notes:
Example:
----------------------------------------
Function: acos Math
Synopsis: returns the inverse cosine of the argument
Prototype: (acos rad)
Arguments: rad <real> angle in radians
Returns: <real>
Notes:
Example:
----------------------------------------
Function: asin Math
Synopsis: returns the inverse sine of the argument
Prototype: (asin rad)
Arguments: rad <real> angle in radians
Returns: <real>
ELF Functions page 41
Notes:
Example:
----------------------------------------
Function: ceil Math
Synopsis: returns the smallest integer greater or equal to the
argument
Prototype: (ceil rval)
Arguments: rval <real>
Returns: <real>
Notes:
Example: (ceil 7.5) ;;; returns 8.0
(ceil -7.5) ;;; returns -7.0
----------------------------------------
Function: cosh Math
Synopsis: returns the hyperbolic cosine of the argument
Prototype: (cosh rad)
Arguments: rad <real> angle in radians
Returns: <real>
Notes:
Example:
----------------------------------------
Function: dtr Math
Synopsis: converts an angle in degrees to radians
Prototype: (dtr ang)
Arguments: ang <real> angle in degrees
Returns: <real> the angle in radians
Notes:
Example: (setq rad (dtr deg))
----------------------------------------
Function: floor Math
Synopsis: returns the largest integer not greater than the
argument
Prototype: (floor rval)
Arguments: rval <real>
Returns: <real>
Notes:
Example: (floor 7.5) ;;; returns 7.0
(floor -7.5) ;;; returns -8.0
----------------------------------------
ELF Functions page 42
Function: hibyte Math
Synopsis: returns the upper (most significant) byte of an
integer
Prototype: (hibyte val)
Arguments: val <int> an integer value
Returns: <int> an integer value containing the MSB
Notes:
Example: (setq keycode (getkey) ;;; get a keypress
char (lobyte keycode) ;;;the character value
scancode (hibyte keycode) ;;; the keyboard scancode
)
----------------------------------------
Function: lobyte Math
Synopsis: returns the lower (least significant) byte of an
integer
Prototype: (lobyte val)
Arguments: val <int> an integer value
Returns: <int> an integer value containing the LSB
Notes:
Example: see hibyte
----------------------------------------
Function: log10 Math
Synopsis: returns the logarithm to the base 10 of the argument
Prototype: (log10 x)
Arguments: x <real>
Returns: <real> or nil of x <= 0.0
Notes:
Example:
----------------------------------------
Function: rand Math
Synopsis: generates a pseudo random number
Prototype: (rand)
Arguments:
Returns: <real> a random value (actually a long integer)
Notes: the sequence has a period of 2^32
Example: (setq x (fix(rem(rand 10))))
----------------------------------------
Function: round Math
Synopsis: rounds a real value
Prototype: (round val places)
ELF Functions page 43
Arguments: val <real> the value to round
places <int> the number of places to
the right of the
decimal
Returns: <real> the rounded value
Notes:
Example: (setq pct (round val 2))
----------------------------------------
Function: rtd Math
Synopsis: converts an angle in radians to degrees
Prototype: (rtd ang)
Arguments: ang <real> angle in radians
Returns: <real> the angle in degrees
Notes:
Example: (setq deg (rtd rad))
----------------------------------------
Function: sinh Math
Synopsis: returns the hyperbolic sine of the argument
Prototype: (sinh rad)
Arguments: rad <real> angle in radians
Returns: <real>
Notes:
Example:
----------------------------------------
Function: srand Math
Synopsis: seeds the random number generator
Prototype: (srand i)
Arguments: i <int> optional seed value
(default = 1)
Returns:
Notes:
Example: (srand pi)
----------------------------------------
Function: tan Math
Synopsis: returns the trigonometric tangent of the argument
Prototype: (tan rad)
Arguments: rad <real> angle in radians
Returns: <real>
ELF Functions page 44
Notes:
Example:
----------------------------------------
Function: tanh Math
Synopsis: returns the hyperbolic tangent of the argument
Prototype: (tanh rad)
Arguments: rad <real> angle in radians
Returns: <real>
Notes:
Example:
----------------------------------------
List Handling Functions
The list data structure is a central part of LISP. ELF adds
functions to manipulate single dimension AutoLISP arrays. You can
sort, insert, delete, replace, and find elements in a list.
----------------------------------------
Function: bsearch List
Synopsis: located a value in a sorted string, integer or real
value list
Prototype: (bsearch vlist key)
Arguments: vlist <list> list of string,
integer, or real values
key <atom> string, integer, or
real value to locate
Returns: <int> 0 based index if found or nil if not found
Notes: the list must be sorted and of type string, integer,
or real
Example: (setq sl (qsort '("CC" "BB" "AA")) ;;; returns ("AA"
"BB" "CC")
(bsearch sl "AA") ;;; returns 0
----------------------------------------
Function: delete List
Synopsis: deletes a list or atom from another list
Prototype: (delete list pos)
Arguments: list <list> list
a list
pso <int> 0 based position to
insert
Returns: new list
ELF Functions page 45
Notes:
Example: (setq new_list(delete old_list 3)) ;;; deletes 4th
element
----------------------------------------
Function: insert List
Synopsis: inserts a list or atom into another list
Prototype: (insert list pos item)
Arguments: list <list> a list
pos <int> 0 based position to
insert
<list> or <atom> val
the list or value to
insert
Returns: new list
Notes:
Example: (setq new_list (insert old_list 3 '("XX" "YY" 123)))
----------------------------------------
Function: lfind List
Synopsis: located a value in an unsorted string, integer or
real value list
Prototype: (lfind vlist key)
Arguments: vlist <list> list of string,
integer, or real values
key <atom> string, integer, or
real value to find
Returns: <int> 0 based index if found or nil if not found
Notes: the list must be of type string, integer, or real
Example: (setq sl '("CC" "BB" "AA"))
(lfind sl "AA") ;;; returns 2
----------------------------------------
Function: lsearch List
Synopsis: located a value in a string, integer or real value
list
Prototype: (lsearch vlist key)
Arguments: vlist <list> list of string,
integer, or real values
key <atom> string, integer, or
real value to locate
Returns: <int> vlist if found or vlist with key appended
if not found
ELF Functions page 46
Notes: the list must be of type string, integer, or real
Example: (setq sl '("CC" "BB" "AA"))
(lsearch sl "XX") ;;; returns ("CC "BB" "AA" "XX")
----------------------------------------
Function: qsort List
Synopsis: sorts a string, integer or real value list
Prototype: (qsort lst)
Arguments: lst <list> list of string,
integer, or real values
Returns: <list> sorted list
Notes:
Example: (qsort '("CC" "BB "AA")) ;;; returns ("AA" "BB" "CC")
(qsort '(3 2 1) ;;; returns (1 2 3)
----------------------------------------
Function: replace List
Synopsis: replace a list or atom in a list with another
Prototype: (replace list pos item)
Arguments: list <list> a list
pos <int> 0 based position to
insert
<list> or <atom> val
the new list or value
to substitute
Returns: new list
Notes:
Example: (replace old_list 3 "XX")
----------------------------------------
Function: symbol List
Synopsis: Displays the contents of a symbol to the screen using
the ELF file/symbol viewer.
Prototype: (symbol sym)
Arguments: sym an AutoLISP symbol / list / function
Returns:
Notes: release 12 only
Example: (symbol (qsort(atoms-family 1))) ;;; displays a list
of all symbols
----------------------------------------
String Handling Functions
The ELF string library contains functions to scan and modify text
strings. In addition, the function (strget) adds a flexible line
editor with an integrated help system.
ELF Functions page 47
----------------------------------------
Function: field String
Synopsis: returns a substring of str1 from token delimiters in
str2 and position.
Prototype: (field str1 str2 pos)
Arguments: str1 <string> the string to search
str2 <string> the string containing
delimiters
Returns: pos <int> the 1 based position in
the string
<string> the nth pos substring of str1 delimited by
chars in str2 or nil
Notes:
Example: (field "AA;BB;CC;DD;EE" ";" 2) ;;; returns "BB"
----------------------------------------
Function: set_edit_help String
Synopsis: sets the user help string list for the function
(strget)
Prototype: (set_edit_help <slist>)
Arguments: <slist> a string list to be displayed when the F1
key is pressed while in (strget). The
first item in the list will be the help
window title.
Returns:
Notes: In release 12 or higher the symbol EDIT_HELP can be
used to set the help string. In release 12
(set_edit_help) will also set this symbol. The symbol
EDIT_HELP can be local to a particular function or
global in scope.
The user can display the default help screen by
pressing F1 the second time.
Example: (set_edit_help '("[ My Help Screen ]" "" "This is my
help message"))
----------------------------------------
Function: sprintf String
Synopsis: same as printf except that nothing is printed, the
string is returned
Prototype: (sprintf format ...)
Arguments: see printf
Returns: <string> formatted string
ELF Functions page 48
Notes: printf to string
Example: (write-line (sprintf "\n%-10s%10.3g%10d" name salary
age) fp)
----------------------------------------
Function: strchr String
Synopsis: finds the first occurrence of ch in str and returns a
substring starting at that character
Prototype: (strchr str ch)
Arguments: str <string> the string to search
ch <int> the character to search
for
Returns: <string> the substring starting in ch
Notes:
Example: (strchr "AABBCC" (ascii "B")) ;;; returns "BBCC"
----------------------------------------
Function: strcmp String
Synopsis: compares two strings for equality (case sensitive)
Prototype: (strcmp str1 str2)
Arguments: str1 <string> the string compare
str2 <string> the string compare
Returns: Value Meaning
-1 str1 < str2
0 str1 = str2
1 str1 > str2
Notes:
Example: (strcmp "Hello World" "HELLO WORLD") returns 1
----------------------------------------
Function: strcspn String
Synopsis: determine the length of the prefix of str1 made
entirely of chars not in str2
Prototype: (strcspn str1 str2)
Arguments: str1 <string> the main string
str2 <string> the string of chars to
test
Returns: <string> the length of the segment of str1 that
begins in the beginning of the string and
is made up entirely of characters that do
not occur in str2
Notes:
Example: (strcspn "AABBCCDDEE" "AB") ;;; returns 0
(strcspn "AABBCCDDEE" "D") ;;; returns 6
----------------------------------------
ELF Functions page 49
Function: strdate String
Synopsis: returns the current date from the internal clock as a
formatted string
Prototype: (strdate)
Arguments: none
Returns: date string as MM-DD-YY
Notes:
Example: (printf "\nToday is %s" (strdate))
----------------------------------------
Function: strdela String
Synopsis: delete all occurrences of chars in str2 from str1
Prototype: (strdela str1 str2)
Arguments: str1 <string> string containing chars
to be deleted
str2 <string> string containing chars
to delete
Returns: <string> str1 with chars from str2 deleted
Notes:
Example: (setq str (strdela "This\t is a test;;::///"
"\t;:/"))
----------------------------------------
Function: strget String
Synopsis: edit a string on the text screen with cursor
positioning and editing, background mask, color
attribute control, and on line help.
Prototype: (strget str len curpos mask attr ...)
Arguments: str <string> optional string to edit
(default - "")
curpos <int> optional starting
cursor position within
string (default - 0)
len <int> optional edit field
length (default 80)
mask <int> optional background
mask character (default
- " ")
attr <int> optional color
attribute (default -
"color: symbol)
... <int> optional keycodes which
will cause strget to
exit (in addition to
<Esc>, <Up>, <Down>,
<Enter>, and <Ctrl-
Enter>
ELF Functions page 50
Returns: <list>
<string> the edited string
<int> keycode of key causing function to exit
<int> cursor position within string at exit
Notes: strget prints the string and mask at the cursor
position then waits for user input. The cursor is
placed at <curpos> within the string.
Insert/overwrite mode is saved between calls to
strget. If a string longer than <len> is edited the
string will "ticker tape", the maximum string length
is 255 characters. Response to keystrokes is as
follows:
Key Action
<Left> move cursor left
<Right> move cursor right
<Up> exit
<Down> exit
<Enter> exit
<Ctrl-Enter> exit
<F1> Display help screen, if the symbol
EDIT_HELP is defined, then the contants of
that symbol is displayed. In versions
prior to release 12, the function
(set_edit_help) can be used to set the
user defined help.
If the user presses F1 the second time,
then the default help screen is displayed.
<Ctrl-Rt> word right
<Ctrl-Lt> word left
<Ctrl-Y> delete from cursor to end of line
<End> move to end
<Home> move to start
<Ins> toggle insert / overwrite mode
Example: (setq name (strget name 25 0 (ascii "_") 23 15360);;;
<F2> will cause strget to exit strget also
----------------------------------------
Function: stricmp String
Synopsis: compares two strings for equality (case insensitive)
Prototype: (stricmp str1 str2)
Arguments: str1 <string> the string compare
str2 <string> the string compare
Returns: Value Meaning
-1 str1 < str2
0 str1 = str2
1 str1 > str2
Notes:
Example: (stricmp "Hello World" "HELLO WORLD") returns 0
----------------------------------------
ELF Functions page 51
Function: strncpy String
Synopsis: copies the first n characters of a string
Prototype: (strncpy str n)
Arguments: str <string> the string to copy
n <int> the number of
characters to copy
Returns: <string> the copied string
Notes:
Example: (strncpy "Hello World" 8) ;;; returns "Hello Wo"
----------------------------------------
Function: strnset String
Synopsis: fills a string
Prototype: (strnset char len)
Arguments: char <int> character to use to
fill string
len <int> number of characters
Returns: <string> the filled string
Notes:
Example: (strnset (ascii " ") 40) ;;; returns a string of 40
spaces
----------------------------------------
Function: strpbrk String
Synopsis: returns a substring of the first occurrence of any
character of str2 in str1
Prototype: (strstr str1 str2)
Arguments: str1 <string> the string to search
str2 <string> the substring
Returns: <string> the substring starting in any char in str2
Notes:
Example: (strpbrk "AABBCCDDEE" "CCBB") ;;; returns "BBCCDDEE"
----------------------------------------
Function: strrchr String
Synopsis: finds the last occurrence of ch in str and returns a
substring starting at that character
Prototype: (strrchr str ch)
Arguments: str <string> the string to search
ch <int> the character to search
for
Returns: <string> the substring starting in ch
Notes:
Example: (strrchr "AABBCC" (ascii "B")) ;;; returns "BCC"
----------------------------------------
ELF Functions page 52
Function: strrev String
Synopsis: returns the string argument with the character order
reversed
Prototype: (strrev str)
Arguments: str <string> string to be reverses
Returns: <string> the reverses string
Notes:
Example: (setq revs (strrev "ABCDE"));;; returns "EDCBA"
----------------------------------------
Function: strspn String
Synopsis: determine the length of the prefix of str1 made
entirely of chars in str2
Prototype: (strspn str1 str2)
Arguments: str1 <string> the main string
str2 <string> the string of chars to
test
Returns: <string> the length of the segment of str1 that
begins in the beginning of the string and
is made up entirely of characters that
occur in str2
Notes:
Example: (strspn "AABBCCDDEE" "AB") ;;; returns 4
----------------------------------------
Function: strstr String
Synopsis: returns a substring of the first occurrence of str2
in str1
Prototype: (strstr str1 str2)
Arguments: str1 <string> the string to search
str2 <string> the substring
Returns: <string> the substring starting in str2
Notes:
Example: (strstr "AABBCCDDEE" "CC") ;;; returns "CCDDEE"
----------------------------------------
Function: strswap String
Synopsis: swaps all occurrences of char1 with char2 in str
Prototype: (strswap str char1 char2)
Arguments: str <string> string to search
char1 <int> character to search for
Returns: char2 <int> character to substitute
for char1
ELF Functions page 53
Notes: <string> the string with swapped chars
Example:
----------------------------------------
Function: strtime String
Synopsis: returns the current time from the internal clock as a
formatted string
Prototype: (strtime)
Arguments: none
Returns: time string as HH:MM:SS
Notes:
Example: (printf "\nThe current time is %s" (strtime))
----------------------------------------
Function: strtok String
Synopsis: returns the first substring of str1 from token
delimiters in str2. subsequent calls after the first
with no arguments will return the second and any
further substrings
Prototype: (strtok str1 str2)
Arguments: str1 <string> the string to search
str2 <string> the string containing
tokens delimiters
Returns: <string> the substring of str1 up but not including
any chars in str2
Notes:
Example: (setq s2 (strtok "AA;BB;CC;DD;EE" ";"))
;;; returns "AA" and saves "BB;CC;DD;EE"
internally
(while (boundp 's2)
(print s2)
(setq s2 (strtok)) ;; then returns "BB", etc
)
----------------------------------------
Function: strtrim String
Synopsis: trim white space (all char values < '!') from the
beginning (left side) and end (right side); and
compresses white space within a string to a single
space between words
Prototype: (strtrim str)
Arguments: str <string> the string to be trimmed
Returns: <string> trimmed string if success or nil if error
ELF Functions page 54
Notes:
Example: (strtrim "\t\t Hello \t world\t ")
returns: "Hello World"
----------------------------------------
Function: strtriml String
Synopsis: trim white space from the beginning (left side) of a
string
Prototype: (strtriml str)
Arguments: str <string> the string to be trimmed
Returns: <string> trimmed string if success or nil if error
Notes:
Example: (strtriml "\t\t Hello world")
returns: "Hello World"
----------------------------------------
Function: strtrimr String
Synopsis: trim white space from the end (right side) of a
string
Prototype: (strtrimr str)
Arguments: str <string> the string to be trimmed
Returns: <string> trimmed string if success or nil if error
Notes:
Example: (strtrimr "Hello world\t ")
returns: "Hello World"
----------------------------------------
Function: tolower String
Synopsis:
Prototype: (tolower char)
Arguments: char <int>
Returns: <char> character converted to lower case
Notes:
Example: (chr(tolower(ascii "A"))) ;;; returns: "a"
----------------------------------------
Function: toupper String
Synopsis:
Prototype: (toupper char)
Arguments: char <int>
Returns: <char> character converted to upper case
Notes:
Example: (chr(toupper(ascii "a"))) ;;; returns: "A"
----------------------------------------
ELF Functions page 55
Character Classification Functions
The character classification functions are equivalent to those
from the "C" function library except that they return nil instead
of 0 to indicate a FALSE condition. This allows the AutoLISP
programmer to test the expression directly with an (if) function.
eg. (If(IsUpper ch) (do something))
----------------------------------------
Function: isalnum Character
Synopsis: returns a non-zero value if argument is a letter or
digit
Prototype: (isalnum char)
Arguments: char <int>
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
Function: isascii Character
Synopsis: returns a non-zero value if argument is an ASCII
character
Prototype: (isascii char)
Arguments: char <int>
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
Function: iscntl Character
Synopsis: returns a non-zero value if argument is a control
character
Prototype: (iscntl char)
Arguments: char <int>
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
Function: isdigit Character
Synopsis: returns a non-zero value if argument is a numeric
digit
Prototype: (isdigit char)
Arguments: char <int>
ELF Functions page 56
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
Function: isgraph Character
Synopsis: returns a non-zero value if argument is a visible
printable character
Prototype: (isgraph char)
Arguments: char <int>
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
Function: islower Character
Synopsis: returns a non-zero value if argument is a lower case
letter
Prototype: (islower char)
Arguments: char <int>
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
Function: isodigit Character
Synopsis: returns a non-zero value if argument is an octal
digit (0-7)
Prototype: (isodigit char)
Arguments: char <int>
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
Function: isprint Character
Synopsis: returns a non-zero value if argument is a printable
character
Prototype: (isprint char)
Arguments: char <int>
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
ELF Functions page 57
Function: ispunct Character
Synopsis: returns a non-zero value if argument is a punctuation
character
Prototype: (ispunct char)
Arguments: char <int>
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
Function: isspace Character
Synopsis: returns a non-zero value if argument is a white-space
character (space, tab, newline, etc)
Prototype: (isspace char)
Arguments: char <int>
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
Function: isupper Character
Synopsis: returns a non-zero value if argument is an upper case
letter
Prototype: (isupper char)
Arguments: char <int>
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
Function: isxdigit Character
Synopsis: returns a non-zero value if argument is a hexadecimal
digit (0-F)
Prototype: (isxdigit char)
Arguments: char <int>
Returns: <int> non-zero if true, nil otherwise
Notes:
Example:
----------------------------------------
Utility / Miscellaneous Functions
Utility functions include those to control the PC speaker, read
the PC system clock, for program debugging, and to execute DOS
programs under program control.
ELF Functions page 58
----------------------------------------
Function: adsdump Utility
Synopsis: prints the data type and value of an AutoLISP symbol
Prototype: (adsdump sym)
Arguments: sym <symbol> an AutoLISP symbol
Returns:
Notes:
Example: (setq x (load_dirs))
(adsdump x)
----------------------------------------
Function: beep Utility
Synopsis: sound a beep on the PC speaker for optional frequency
and duration
Prototype: (beep freq duration)
Arguments: freq <int> frequency in hertz
duration <real> length/duration of the
beep in decimal seconds
Returns:
Notes:
Example: (beep 440 1.0) ;;; beep middle A for one second
----------------------------------------
Function: clock Utility
Synopsis: reads the current internal clock
Prototype: (clock)
Arguments: none
Returns: <real> the current internal clock register
reading in seconds (0.01 second precision)
Notes:
Example: (setq end (+(clock) 2.5)) ;;; delay for 2.5 seconds
(while (> end (clock)))
----------------------------------------
Function: exit Utility
Synopsis: cancels execution and returns to the Command: prompt
Prototype: (exit)
Arguments:
Returns:
Notes: duplicates the (exit) function available in release
12 for pre-release 12 versions
Example:
----------------------------------------
ELF Functions page 59
Function: getdosver Utility
Synopsis: returns the DOS version
Prototype: (getdosver)
Arguments:
Returns: <list>
<int> major version number
<int> minor version number
Notes:
Example: (set ver (getdosver))
(printf "DOS Version %d.%d" (car ver) (cadr ver))
----------------------------------------
Function: last_error Utility
Synopsis: returns the last internal error message
Prototype: (last_error)
Arguments:
Returns: <string> the error message
Notes: with release 12 the symbol *LAST_ERROR* also contains
this message
Example: (printf "\nThe last ELF error was %s" (last_error))
----------------------------------------
Function: nosound Utility
Synopsis: turns off the PC speaker after a sound function
Prototype: (nosound)
Arguments:
Returns:
Notes:
Example: see sound
----------------------------------------
Function: pause_key Utility
Synopsis: prints "press any key to continue..." and waits for a
keystroke
Prototype: (pause_key)
Arguments:
Returns:
Notes:
Example:
----------------------------------------
Function: sound Utility
Synopsis: turns on the PC speaker at a specified tone frequency
Prototype: (sound freq)
ELF Functions page 60
Arguments: freq <int> frequency in hertz
Returns:
Notes: see beep
Example: (defun play(freq time)
(sound freq) ;;; turn on note
(wait time) ;;; wait time seconds
(nosound) ;;; turn it off
)
(play 440 0.5);;; sounds middle A for 1/2 second
----------------------------------------
Function: system Utility
Synopsis: executes a DOS command
Prototype: (system cmd)
Arguments: cmd <string> DOS command or program
Returns: <int> DOS errorlevel if successful or -1 on
error
Notes: You MUST run "cfig386 acad -maxreal FFFFh" to
configure the PharLap DOS extender to allow realmode
programs to run (select a value large enough to run
the desired programs). This function is preferable to
SH or SHELL, or executing some programs from an
ACAD.PGP entry, when the return value must be known.
It's also a little faster.
Example: (keystuff "/FRmyfile\n/FSY/QY")
(if(>= (system "123") 0)
(princ "Lotus 123 executed successfully"))
----------------------------------------
Function: wait Utility
Synopsis: suspend execution for a specified time duration
Prototype: (wait ti)
Arguments: ti <real> time in decimal seconds
Returns:
Notes:
Example: (wait 2.5) ;;; delays for 2.5 seconds
----------------------------------------
Symbols
(release 12 or later only)
Symbol Description
*last_error* the last error message string
color default color attribute
edit_help string list with user defined help for the
(strget) function
menu_help string list with user defined help for the
(wmenu) function
ELF Functions page 61
ELF Functions page 62
Copyright
The ELF program code and documentation are copyrighted material,
registered with the US Copyright office and protected under US
and International copyright laws. All rights are reserved.
Trademark
Mountain Software and ELF are trademarks of Mountain Software.
MS-DOS is a registered trademark of Microsoft Corporation. PC-DOS
is a registered trademark of IBM Corporation. AutoCAD and
AutoLISP are registered trademarks of AutoDesk.
Index
*last_error* . . . . . 59, 60 elf 1-11, 17, 27, 30, 37-39,
& . . . . . . . . . . . . . 40 44, 46, 59, 62
&& . . . . . . . . . . . . 40 elfapps . . . . . . . 1, 2, 4
| . . . . . . . . . 1, 39, 40 elfdos . . . . . . . 1, 2, 5
|| . . . . . . . . . . . . 40 entity . . . . . . . . . 1, 2
acad 3-9, 30, 32, 34, 36-38, erasefile . . . . . . . 32, 37
60 esc . . . . . . 8, 20, 23, 49
acadapp . . . . . . . . . . 3 exit . 8, 22, 23, 49, 50, 58
access . . . . . . . . 20, 30 exp . . . . . . . . . 1, 3, 4
acos . . . . . . . . . . . 40 exsubr . . . . . . . . . . 9
ads . . . . . . . . . . . 3, 4 f1 8, 11, 17, 18, 23, 47, 50
adsdump . . . . . . . . . . 58 ff . . . . . . . . . . . . 7
asin . . . . . . . . . . . 40 field . . . . . . . 29, 47, 49
attr 10, 12-15, 18, 19, 23, 2 file_exists . . . . . . . . 32
5, 26, 49 findfile . . . . . . . . 3, 7
attribute 1, 10-15, 17-20, 22 findfirst . . . . . 20, 32-35
-26, 32, 33, 35, 49, findnext . . . . . . . 33-35
60 flipscreen . . . . . . . . 11
autocad . . . 1-5, 7, 9-11, 62 floor . . . . . . . . . . . 41
autodesk . . . . . . . 1, 62 floppy . . . . . . 6, 19, 31
autolisp 1-5, 9, 10, 12, 15, fullpath . . . . . . . . . 34
17, 33, 34, 37, 39, get_cursor . . . . . . 14-16
44, 46, 55, 58, 62 get_video . . . . . 12, 13, 15
beep . . . . . . . 10, 58, 60 getch . . . . . . . 1, 27, 28
boundp . . . . . . . . 34, 53 getche . . . . . . . . 1, 28
box . . . . . . . . . . . . 12 getdir . . . . . . . . . . 34
bsearch . . . . . . . . . . 44 getdisk . . . . . . . . . . 35
capslock . . . . . . . . . 29 getdiskfree . . . . . . . . 34
cd . . . . . . . . . . . . 5 getdosver . . . . . . . . . 59
ceil . . . . . . . . . . . 41 getkey . . . . . 1, 27-29, 42
chdir . . . . . . . . . 5, 30 getxy . . . . . . . 15, 16, 21
chpath . . . . . . . . . . 31 gotoxy . . . . . . . . 15, 16
clock . . . 2, 49, 53, 57, 58 hibyte . . . . . . . . 28, 42
cls . . . . . . . . . . 5, 12 insert . . . 2, 29, 44-46, 50
color 1, 3, 10-15, 17-20, 22- isalnum . . . . . . . . . . 55
26, 39, 49, 60 isascii . . . . . . . . 11, 55
commands . . . . . . 1-3, 5-9 iscntl . . . . . . . . . . 55
copyfile . . . . . . . . . 38 isdigit . . . . . . . . . . 55
cosh . . . . . . . . . . . 41 isgraph . . . . . . . . . . 56
dcd . . . . . . . . . . . . 5 islower . . . . . . . . . . 56
dcopy . . . . . . . . . . 5, 6 isodigit . . . . . . . . . 56
ddel . . . . . . . . . . . 6 isprint . . . . . . . . . . 56
ddir . . . . . . . . . . . 6 ispunct . . . . . . . . . . 57
delete 2, 6, 8, 44, 45, 49, 5 isspace . . . . . . . . . . 57
0 isupper . . . . . . . . 55, 57
derase . . . . . . . . . . 6 isxdigit . . . . . . . . . 57
dir . . . . 6, 10, 26, 36, 37 kbhit . . . . . . . . . 1, 28
dmd . . . . . . . . . . . . 8 key_clear . . . . . . . . . 29
dmove . . . . . . . . . . 6, 7 key_ready . . . . . . . . . 29
drd . . . . . . . . . . . . 8 key_stat . . . . . . . . . 29
drename . . . . . . . . . . 6 key_stuff . . . . . 27, 29, 30
dsd . . . . . . . . . . . . 9 keycode 4, 22, 23, 28, 29, 42
dtr . . . . . . . . . . . . 41 , 50
edit_help . . . . . 47, 50, 60 keycodes . . . . . . . 28, 49
keystuff . . . . . . . . . 60 shareware . . . . . . . . 1, 2
last_error . . . . . . 59, 60 sinh . . . . . . . . . . . 43
len . . . . . . . . 19, 49-51 solid . . . . . . . . . . . 24
lfind . . . . . . . . . . . 45 sound . . . . 1, 2, 10, 58-60
line 1, 2, 6, 8, 16-19, 22-24 splitpath . . . . . . . 36, 37
, 26, 37, 38, 39, 46 sprintf . . . . . . 35, 47, 48
, 48-50 srand . . . . . . . . . . . 43
list 1, 2, 6, 7, 10-12, 16, 1 strchr . . . . . . . . . . 48
7, 21, 22, 23, 28, 3 strcmp . . . . . . . . . . 48
0, 33-35, 37-39, 44- strcspn . . . . . . . . . . 48
47, 50, 59, 60 strdate . . . . . . . . . . 49
load_dirs . . . . . . . 35, 58 strdela . . . . . . . . . . 49
load_files . . . . . . 35, 36 strget 19, 46, 47, 49, 50, 60
lobyte . . . . . . . . 28, 42 stricmp . . . . . . . . . . 50
log10 . . . . . . . . . . . 42 string 1, 2, 10, 11, 13-15, 1
look . . . . . . 7-9, 17, 38 7-20, 22, 23, 25-39,
lsearch . . . . . . . . 45, 46 44-54, 59, 60
lsp . . 4, 12, 27, 28, 36, 37 strncpy . . . . . . . . . . 51
makepath . . . . . . . . . 36 strnset . . . . . . . . . . 51
md . . . . . . . . . . . . 8 strpbrk . . . . . . . . . . 51
menu_help . . . 17, 18, 23, 60 strrchr . . . . . . . . . . 51
mkdir . . . . . . . . . 8, 36 strrev . . . . . . . . . . 52
movefile . . . . . . . . . 38 strspn . . . . . . . . . . 52
nosound . . . . . . . . 59, 60 strstr . . . . . . . . 51, 52
numlock . . . . . . . . . . 29 strswap . . . . . . . . . . 52
password . . . . . . . . . 8 strtime . . . . . . . . . . 53
pause_key . . . . . . . . . 59 strtok . . . . . . . . . . 53
pgdn . . . . . . . . . 8, 23 strtrim . . . . . . . . 53, 54
pgp . . . . . . . . . . . . 60 strtriml . . . . . . . . . 54
pgup . . . . . . . . . 8, 23 strtrimr . . . . . . . . . 54
pharlap . . . . . . . . . . 60 subr . . . . . . . . . . . 9
point . . . . . . . . . . . 10 substring . . . 47, 48, 51-53
popup . . . . . . . . . . . 1 substrings . . . . . . . . 53
printf 1, 10, 11, 13, 15, 25, symbol 1, 2, 5, 9-11, 15, 17-
34, 47, 48, 49, 53, 19, 22, 23, 25, 37,
59 46, 47, 49, 50, 58,
prts . . . . . . . . . . . 13 59, 60
puts . . . . . . . 13, 14, 26 system 1, 11, 17, 30, 33, 46,
qsort . . . . . 9, 36, 44, 46 57, 60
radians . . 10, 40, 41, 43, 44 tan . . . . . . . . . . . . 43
rand . . . . . . . . . 11, 42 tanh . . . . . . . . . . . 44
rd . . . . . . . . . . . 8, 9 text 1, 5, 8, 11-15, 17, 19,
read_file . . . . . . . 37-39 23-26, 37-39, 46, 49
replace . . . . . . 2, 44, 46 tolower . . . . . . . . . . 54
rmdir . . . . . . . . . 8, 36 toupper . . . . . . . . . . 54
round . . . . . . . . . 42, 43 unlink . . . . . . . . . . 37
rtd . . . . . . . . . . . . 43 utility . . . . . 1, 2, 57-60
scancode . . . . . . . 28, 42 ver . . . . . . . . . . 9, 59
scr_fill . . . . . . . 14, 15 wait . . . . . . . . . 23, 60
scr_printf . . . . . . 11, 15 wclose . . . . . . . . . . 18
sd . . . . . . . . . . . . 9 wcloseall . . . . . . . . . 18
set_cursor . . . . . . 14-17 wclreol . . . . . . . . . . 18
setdisk . . . . . . . . . . 36 wcls . . . . . . . . . 18, 19
setq 9, 13, 15, 16, 20, 21, 2 wgetdrive . . . . . . . 19, 20
3, 24, 28, 29, 34-37 wgetfile . . . . . . . 8, 20
, 39, 41-46, 49, 50, wgetstr . . . . . . . . . . 19
52, 53, 58 wgetxy . . . . . . . . . . 21
wgotoxy . . . . . . . . . . 21
winfo . . . . . . . . . . . 21
wmenu . . . . . 17, 22, 23, 60
wmsg . . . . . . . . . 23, 24
wopen . . . . . . . . . . . 24
wpopup . . . . . . 19, 24, 25
wprintf . . . . . . . . . . 25
wprts . . . . . . . . . 17, 25
wputcen . . . . . . . . . . 25
wputs . . . . . . . . . 17, 26
write_file . . . . . . 37, 39
wscroll . . . . . . . . . . 26
wshadow . . . . . . . . 26, 27
wtitle . . . . . . . . . . 27
xload . . . . . . . . . . . 3